From: san Date: Fri, 30 Sep 2011 10:37:37 +0000 (+0000) Subject: Bug: Crash if user close current window through shortcut during displayed context... X-Git-Tag: BR_HDF_dev_for_QT_QWT~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e86c01713fe61e774af2b065dfed706cd6bdeec9;p=modules%2Fgui.git Bug: Crash if user close current window through shortcut during displayed context menu. Fix: Used QPointer for QMenu and QMenu reparented to current window. --- diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index b4940a458..32f94631a 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -2539,7 +2540,7 @@ void QtxWorkstack::onContextMenuRequested( QWidget* w, QPoint p ) myWorkWin = w; myWorkArea = anArea; - QMenu* pm = new QMenu(); + QPointer pm = new QMenu( myWorkWin ); if ( lst.count() > 1 ) {