Hello,
the the codesnippets' dock-position gets forgotten after shutting down Code::Blocks. A possible solution is to modify the
OnRelease method from
void CodeSnippets::OnRelease(bool appShutDown)
// ----------------------------------------------------------------------------
{
if (not GetSnippetsWindow()) return;
// Don't close down if file checking is active
while ( m_nOnActivateBusy )
{ wxMilliSleep(10) ; wxYield();
}
CodeBlocksDockEvent evt(cbEVT_REMOVE_DOCK_WINDOW);
evt.pWindow = GetSnippetsWindow();
Manager::Get()->GetAppWindow()->ProcessEvent(evt);
GetSnippetsWindow()->Destroy();
SetSnippetsWindow(0);
}
to
void CodeSnippets::OnRelease(bool appShutDown)
// ----------------------------------------------------------------------------
{
if (not GetSnippetsWindow()) return;
if(!appShutDown)//Don't remove the pane, if Code::Blocks shuts down
{
// Don't close down if file checking is active
while ( m_nOnActivateBusy )
{ wxMilliSleep(10) ; wxYield();
}
CodeBlocksDockEvent evt(cbEVT_REMOVE_DOCK_WINDOW);
evt.pWindow = GetSnippetsWindow();
Manager::Get()->GetAppWindow()->ProcessEvent(evt);
GetSnippetsWindow()->Destroy();
SetSnippetsWindow(0);
}
}
I'm not familiar with wxAUI, so I don't know, if this will lead to a memory leak, but I don't think so, because a wxWidgets window normally deletes it's child controls/windows automatically while being destroyed, doesn't it?