diff options
-rw-r--r-- | src/VBox/Debugger/VBoxDbgConsole.cpp | 6 | ||||
-rw-r--r-- | src/VBox/Debugger/VBoxDbgStatsQt.cpp | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/VBox/Debugger/VBoxDbgConsole.cpp b/src/VBox/Debugger/VBoxDbgConsole.cpp index 6b9d5af8891..d9ea1ccc070 100644 --- a/src/VBox/Debugger/VBoxDbgConsole.cpp +++ b/src/VBox/Debugger/VBoxDbgConsole.cpp @@ -489,6 +489,9 @@ VBoxDbgConsole::VBoxDbgConsole(VBoxDbgGui *a_pDbgGui, QWidget *a_pParent/* = NUL m_pTimer(NULL), m_fUpdatePending(false), m_Thread(NIL_RTTHREAD), m_EventSem(NIL_RTSEMEVENT), m_fTerminate(false), m_fThreadTerminated(false) { + /* Delete dialog on close: */ + setAttribute(Qt::WA_DeleteOnClose); + /* * Create the output text box. */ @@ -993,10 +996,7 @@ void VBoxDbgConsole::closeEvent(QCloseEvent *a_pCloseEvt) { if (m_fThreadTerminated) - { a_pCloseEvt->accept(); - delete this; - } } diff --git a/src/VBox/Debugger/VBoxDbgStatsQt.cpp b/src/VBox/Debugger/VBoxDbgStatsQt.cpp index 4ab64fa92c5..7818824d681 100644 --- a/src/VBox/Debugger/VBoxDbgStatsQt.cpp +++ b/src/VBox/Debugger/VBoxDbgStatsQt.cpp @@ -3042,6 +3042,9 @@ VBoxDbgStats::VBoxDbgStats(VBoxDbgGui *a_pDbgGui, const char *pszPat/* = NULL*/, : VBoxDbgBaseWindow(a_pDbgGui, pParent, "Statistics") , m_PatStr(pszPat), m_pPatCB(NULL), m_uRefreshRate(0), m_pTimer(NULL), m_pView(NULL) { + /* Delete dialog on close: */ + setAttribute(Qt::WA_DeleteOnClose); + /* * On top, a horizontal box with the pattern field, buttons and refresh interval. */ @@ -3148,7 +3151,6 @@ void VBoxDbgStats::closeEvent(QCloseEvent *a_pCloseEvt) { a_pCloseEvt->accept(); - delete this; /** @todo This is wrong! We get more events after this one and end up using memory after freeing it in vPolishSizeAndPos(). (Qt3 holdover?) */ } |