Commit 480f8235 authored by Ilya Lysenkov's avatar Ilya Lysenkov

Qt: fixed destroyAllWindow crash (patch #794)

parent f010539a
...@@ -988,16 +988,25 @@ void GuiReceiver::destroyAllWindow() ...@@ -988,16 +988,25 @@ void GuiReceiver::destroyAllWindow()
//#TODO check externalQAppExists and in case it does, close windows carefully, //#TODO check externalQAppExists and in case it does, close windows carefully,
// i.e. apply the className-check from below... // i.e. apply the className-check from below...
qApp->closeAllWindows(); qApp->closeAllWindows();
}else{ }
else
foreach (QObject *obj, QApplication::topLevelWidgets()) {
bool isWidgetDeleted = true;
while(isWidgetDeleted)
{ {
if (obj->metaObject ()->className () == QString("CvWindow")) isWidgetDeleted = false;
QWidgetList list = QApplication::topLevelWidgets();
for (int i = 0; i < list.count(); i++)
{ {
delete obj; QObject *obj = list.at(i);
if (obj->metaObject ()->className () == QString("CvWindow"))
{
delete obj;
isWidgetDeleted = true;
break;
}
} }
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment