From 96ce3ee96fbf8b6234b17cb568ec57cbb93460b8 Mon Sep 17 00:00:00 2001 From: romashin Date: Sat, 19 Apr 2008 18:39:18 +0300 Subject: [PATCH] Enabled Gecko destroy on application close --- embedding/browser/qt/tests/mainwindow.cpp | 8 ++++++++ embedding/browser/qt/tests/mainwindow.h | 1 + 2 files changed, 9 insertions(+) diff --git a/embedding/browser/qt/tests/mainwindow.cpp b/embedding/browser/qt/tests/mainwindow.cpp index d4a6ab478be..af075cf68fd 100644 --- a/embedding/browser/qt/tests/mainwindow.cpp +++ b/embedding/browser/qt/tests/mainwindow.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "qgeckoembed.h" @@ -76,6 +77,13 @@ MyMainWindow::MyMainWindow() connect( location, SIGNAL(returnPressed()), SLOT(changeLocation())); + connect( qApp, SIGNAL(lastWindowClosed()), SLOT(mainQuit())); +} + +void MyMainWindow::mainQuit() +{ + delete qecko; + qecko = NULL; } void MyMainWindow::fileOpen() diff --git a/embedding/browser/qt/tests/mainwindow.h b/embedding/browser/qt/tests/mainwindow.h index 4b9a5b3582f..54aa68aa3cb 100644 --- a/embedding/browser/qt/tests/mainwindow.h +++ b/embedding/browser/qt/tests/mainwindow.h @@ -19,6 +19,7 @@ public slots: void goBack(); void goForward(); void stop(); + void mainQuit(); public: QGeckoEmbed *qecko;