From 8a772549d7def2c11598ed1ed6e5c510c68e2edd Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Sat, 4 Jul 2015 18:59:29 +0200 Subject: [PATCH] Fix for #9659 - Qt may send more then one close event to a window. Therefore multiple calls to unregisterView for a GuiView are possible. The first one removes the view from the list of known views, subsequent calls do nothing. --- src/frontends/qt4/GuiApplication.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 8bd22c8c03..fc96995968 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -2735,10 +2735,11 @@ void GuiApplication::commitData(QSessionManager & sm) void GuiApplication::unregisterView(GuiView * gv) { - LAPPERR(d->views_[gv->id()] == gv); - d->views_.remove(gv->id()); - if (current_view_ == gv) - current_view_ = 0; + if(d->views_.contains(gv->id()) && d->views_.value(gv->id()) == gv) { + d->views_.remove(gv->id()); + if (current_view_ == gv) + current_view_ = 0; + } } -- 2.39.2