[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Freeing of memory and DLLs



PureBytes Links

Trading Reference Links

This is something that's been perplexing me for some time.

I write a simple C++ DLL that, when called, creates a class. Nothing fancy, it just creates a class. In the class constructor I use the fstream commands to append to a file that says "Class created". For the descructor, it simply appends to the same file "Class deleted".

Like I said, nothing fancy. Anyways, anytime the DLL is applied and called on a chart (TS 2000i btw) the constructor is properly called - I know because in the file i've got a serious of 'class created' messages. However, regardless of if I leave the DLL/strategy on, turn it off, or delete it off the chart, or even close TS, I NEVER have the message 'class deleted' in the file log. So I've got to wonder, what happens with stuff like classes in memory? Are they ever cleared out, so to speak? And if there are, why arn't their destructors ever called in TS?

Thoughts?