Click here to Skip to main content
15,918,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My app crash on close because of a memory heap corruption due to view double destruction.

My app use a splitter with some views loaded at oncreateclient method on frame and I think it interfere with normal mfc document view architecture workflow.

I tryed to debug inside my app and inside mfc in order to understand why my views are destroyed twice but I didn't understand. One thing I'm sure, I'm not destroying them from my app, this double destroying is done from mfc.

Can anyone give me a suggestion?

Thank you.
Posted
Updated 26-Mar-12 0:16am
v6
Comments
Jochen Arndt 26-Mar-12 6:47am    
How did you create the views? By default the view windows are created when their parent frame window is created by the document template. I did not have used splitter frames so far, but it should be handled in a similar way. So your view creation may interfere with the MFC handling of views.

1 solution

I would suggest to put a breakpoint in the MFC CView::~CView function and see, where the double destroy comes from.

Note that views are normally destroyed in the OnDestroy member function with

delete this;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900