set m_isBeingDeleted to true (only) in SendDestroyEvent(); call it as early as possible during the window destruction to ensure that destroy event handlers can still access the full window object

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-20 18:33:33 +00:00
parent 8c2654ce3d
commit c6212a0cb7
42 changed files with 71 additions and 94 deletions

View File

@@ -518,7 +518,6 @@ bool wxWindowMSW::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
void wxWindowMSW::Init()
{
// MSW specific
m_isBeingDeleted = false;
m_oldWndProc = NULL;
m_mouseInWindow = false;
m_lastKeydownProcessed = false;
@@ -540,7 +539,7 @@ void wxWindowMSW::Init()
// Destructor
wxWindowMSW::~wxWindowMSW()
{
m_isBeingDeleted = true;
SendDestroyEvent();
#ifndef __WXUNIVERSAL__
// VS: make sure there's no wxFrame with last focus set to us:
@@ -3949,8 +3948,6 @@ bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT WXUNUSED_IN_WINCE(cs),
bool wxWindowMSW::HandleDestroy()
{
SendDestroyEvent();
// delete our drop target if we've got one
#if wxUSE_DRAG_AND_DROP
if ( m_dropTarget != NULL )