]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Bug: Crash if user close current window through shortcut during displayed context...
authorsan <san@opencascade.com>
Fri, 30 Sep 2011 10:37:37 +0000 (10:37 +0000)
committersan <san@opencascade.com>
Fri, 30 Sep 2011 10:37:37 +0000 (10:37 +0000)
Fix: Used QPointer for QMenu and QMenu reparented to current window.

src/Qtx/QtxWorkstack.cxx

index b4940a4587af90dfd17fa75901f1b7fc5f544e8e..32f94631a6f9503e8429f74ad1883e09e459834a 100644 (file)
@@ -27,6 +27,7 @@
 #include <QStyle>
 #include <QRegExp>
 #include <QLayout>
+#include <QPointer>
 #include <QPainter>
 #include <QSplitter>
 #include <QFocusEvent>
@@ -2539,7 +2540,7 @@ void QtxWorkstack::onContextMenuRequested( QWidget* w, QPoint p )
   myWorkWin = w;
   myWorkArea = anArea;
 
-  QMenu* pm = new QMenu();
+  QPointer<QMenu> pm = new QMenu( myWorkWin );
 
   if ( lst.count() > 1 )
   {