News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Segfault in wxFlatNotebook

Started by thomas, January 08, 2006, 04:36:03 PM

Previous topic - Next topic

thomas

While redesigning the Manager framework, I encountered the problem that the configuration was no longer being saved. The substantial change to ConfigManger was that it was no longer an automatic object, but managed (and thus freed) by the Manager class. Configurations are saved inside ConfigManger's destructor, so this suggested that ConfigManager was never deleted.

After searching for a while without any result, I stepped through it in the debugger and found that Code::Blocks crashes when EditorManager frees the notebook pages in wxFlatNotebook.cpp, line 296:

bool wxFlatNotebook::DeleteAllPages()
{
   if(m_windows.empty())
      return false;

   Freeze();
   std::vector<wxWindow*>::iterator iter = m_windows.begin();
   for(; iter != m_windows.end(); iter++)
   {
      delete (*iter);
   }
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

mandrav

Nice catch :)
This isn't wxFlatNotebook's fault but EditorManager's. I 've committed the fix in rev1684.
Be patient!
This bug will be fixed soon...