Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deconstructors ~

Status
Not open for further replies.

VBGuyUsingVC

Programmer
Jan 10, 2002
24
US
I finally got my ActiveX control working like it should except that any app I use it on always crashes on exit. I've even used the Test Container application that comes with VC++.

How do I clean up my control's instance data. Should I put some type of code in the deconstructor section?

Please advise, thanks!
 
Program crashes upon exit are often caused by your program attempting to use a pointer or object that has already been destroyed. You may need to adjust the order of deletions if you manually delete() or free() memory associated with an object or variable. Just check to be sure that no other part of your program attempts to use those pointers or objects afterwards. It's also good practice to always set a pointer to NULL just after you delete memory associated with it. Then, you should also always check whether a variable is NULL before attempting to use it.

Hope this helps. Your actual problem is too vague to pinpoint specifically.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top