Author Topic: Segfault in wxFlatNotebook  (Read 3504 times)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Segfault in wxFlatNotebook
« 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);
   }
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Segfault in wxFlatNotebook
« Reply #1 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.
Be patient!
This bug will be fixed soon...