Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
CodeSnippets save-dock-position issue and possible solution
(1/1)
wxLearner:
Hello,
the the codesnippets' dock-position gets forgotten after shutting down Code::Blocks. A possible solution is to modify the OnRelease method from
--- Code: (codesnippets.cpp, line 160) ---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);
}
--- End code ---
to
--- Code: ---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);
}
}
--- End code ---
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?
Pecan:
Thank you. Will correct on next commit.
Navigation
[0] Message Index
Go to full version