Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: thomas on January 08, 2006, 04:36:03 pm

Title: Segfault in wxFlatNotebook
Post by: thomas on January 08, 2006, 04:36:03 pm
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);
   }
Title: Re: Segfault in wxFlatNotebook
Post by: mandrav on January 08, 2006, 04:45:56 pm
Nice catch :)
This isn't wxFlatNotebook's fault but EditorManager's. I 've committed the fix in rev1684.