doubt regarding the destruction of objects we create 
Author Message
 doubt regarding the destruction of objects we create


I have a CImageList object as part of my CMainFrame
I am using it for setting up the cold and hot toolbar bitmaps for my toolbar
I am calling the Create function of the CImageList from the OnCreate of my
everything worked fine
no errors
no asserts
no probs

BUT I was just wondering anout the fact that I have created the object but I
have not destroyed it
Is it compulsory to do that
I presume that since the CImageList object is created as a reference object
on the heap it will be destroyed when my program exits. But what if someone
keeps running my program without closing it for say 3-4 days. will this
cause any memory leaks?????

regards and thanks


Sun, 26 Oct 2003 16:47:23 GMT  
 doubt regarding the destruction of objects we create
No, everything is fine.  It will not leak, since it will be destroyed when the
CMainFrame object is destroyed.  No matter if your program runs for a year.

Sun, 26 Oct 2003 17:33:56 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Confused regarding apartments, when COM objects are forced by COM to be created and when shared

2. Doubt regarding device driver entry points

3. doubts regarding conversion

4. Doubt Regarding Function Address

5. doubt regarding SHFILEOPSTRUCT

6. Doubt in VC++ 4.1 - Regarding setting the Memory model

7. another doubt regarding threads - reference to Bob Moore's site

8. CListCtrl regarding doubt

9. Object destruction

10. ATL multithreaded object creation and destruction problem

11. Destruction of object using ADO crashes my program...

12. Destruction of COM objects.


Powered by phpBB® Forum Software