[wx-dev] recent ~wxAuiManager change

Robin Dunn robin at alldunn.com
Fri May 11 00:49:57 PDT 2007


Alec Ross wrote:
> In message <Xh$5GRHSV$QGFwzf at arlross.demon.co.uk>, Alec Ross 
> <alec at arlross.demon.co.uk> writes
>> Would
>>
>> In message <46437B21.1010101 at alldunn.com>, Robin Dunn
>> <robin at alldunn.com> writes
>>>
>>> wxAuiManager::~wxAuiManager()
>>> {
>> ...
>>>        if( pinfo.window && !pinfo.window->GetParent() )
>>          {
>>>            delete pinfo.window;
>>              pinfo.window = 0;
>>          }
>>>    }
>>>    delete m_art;
>>> }
>>
>> help?
>>
> Oops.  The question should have been about nulling the pointer in other 
> contexts of deleting the pinfo.window pointer.

Correct.  For example I think the same problem could be observed in C++ 
if the App object is the one that owns the wxAuiManager instance, and a 
frame is the window being managed.  Then when you close the frame it 
destroys all of its children, and then finally when the app is deleted 
and it is destroying the manager and it goes through that loop looking 
at window pointers that have all been destroyed already and are pointing 
at potentially garbage memory.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wx-dev mailing list