From: <bar...@us...> - 2007-07-27 02:41:42
|
Revision: 5248 http://bacula.svn.sourceforge.net/bacula/?rev=5248&view=rev Author: bartleyd2 Date: 2007-07-26 19:35:39 -0700 (Thu, 26 Jul 2007) Log Message: ----------- prevent a segfault when closing and there are child objects in the page selector. Modified Paths: -------------- trunk/bacula/src/qt-console/mainwin.cpp Modified: trunk/bacula/src/qt-console/mainwin.cpp =================================================================== --- trunk/bacula/src/qt-console/mainwin.cpp 2007-07-27 01:22:03 UTC (rev 5247) +++ trunk/bacula/src/qt-console/mainwin.cpp 2007-07-27 02:35:39 UTC (rev 5248) @@ -248,10 +248,15 @@ m_isClosing = true; writeSettings(); /* close all non console pages, this will call settings in destructors */ - foreach(Pages *page, m_pagehash) { - if (page != page->console()) { - page->console()->setCurrent(); - page->closeStackPage(); + while (m_consoleHash.count() < m_pagehash.count()) { + foreach(Pages *page, m_pagehash) { + if (page != page->console()) { + QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(page); + if (pageSelectorTreeWidgetItem->childCount() == 0) { + page->console()->setCurrent(); + page->closeStackPage(); + } + } } } /* close the console pages and terminate connection */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |