Re: PreTranslateMessage gets called wrongly (after view destroyed)
From: Corey Cooper (CoreyC_at_InnovativeDesign.com)
Date: 06/23/04
- Previous message: Andre: "scrollbars appear after resize dialog box"
- In reply to: Kieren Gracie: "RE: PreTranslateMessage gets called wrongly (after view destroyed)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Jun 2004 13:48:05 -0700
Have you tried destroying your controls in the OnDestroy() override, and
leave the destructor to actual memory deallocation of items that need it? As
I understand it, deleting the controls only sends messages asking them to
destroy themselves, so that should be done within the MFC destruction
process, leaving the CPP destruction process to actually release memory as
nessisary for things that need it like memory allocated with new.
C.
"Kieren Gracie" <KierenGracie@discussions.microsoft.com> wrote in message
news:940824EB-BD95-4464-AC1C-3D9DCAF24536@microsoft.com...
> More more info - if I don't delete the controls I created in the
destructor, then I don't see the ASSERT failure but of course I then get a
memory leak.
>
> So the order of stuff is -
>
> Destroy view
> View destructor gets called
> - in view destructor, delete control
> PreTranslateMessage gets called in the class which has been destroyed,
oops, ASSERT failure when I call IsChild
>
> But if I don't delete the control, PreTranslateMessage doesn't get called
after the object is destroyed.
>
> Anyone?
- Previous message: Andre: "scrollbars appear after resize dialog box"
- In reply to: Kieren Gracie: "RE: PreTranslateMessage gets called wrongly (after view destroyed)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|