Bug 545651 - QApplication is not starting in tab child process. r=dougt

This commit is contained in:
Oleg Romashin 2010-02-17 21:14:48 +02:00
parent ec508d3a01
commit 8662fa2b8f
2 changed files with 15 additions and 18 deletions

View File

@ -38,6 +38,7 @@
#ifdef MOZ_WIDGET_QT
#include <QtGui/QX11EmbedWidget>
#include <QApplication>
#endif
#include "TabChild.h"
@ -65,6 +66,12 @@
using namespace mozilla::dom;
#ifdef MOZ_WIDGET_QT
static QApplication *gQApp = nsnull;
extern int gArgc;
extern char **gArgv;
#endif
NS_IMPL_ISUPPORTS1(ContentListener, nsIDOMEventListener)
NS_IMETHODIMP
@ -87,6 +94,9 @@ TabChild::Init()
{
#ifdef MOZ_WIDGET_GTK2
gtk_init(NULL, NULL);
#elif defined(MOZ_WIDGET_QT)
if (!qApp)
gQApp = new QApplication(gArgc, (char**)gArgv);
#endif
nsCOMPtr<nsIWebBrowser> webBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID);
@ -324,6 +334,11 @@ TabChild::destroyWidget()
TabChild::~TabChild()
{
#ifdef MOZ_WIDGET_QT
if (gQApp)
delete gQApp;
gQApp = nsnull;
#endif
destroyWidget();
nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(mWebNav);
if (webBrowser) {

View File

@ -51,13 +51,6 @@
#include "prlog.h"
#endif
#ifdef MOZ_IPC
#include <QApplication>
static QApplication *sQApp = nsnull;
extern int gArgc;
extern char **gArgv;
#endif
#ifdef PR_LOGGING
PRLogModuleInfo *gWidgetLog = nsnull;
PRLogModuleInfo *gWidgetFocusLog = nsnull;
@ -69,11 +62,6 @@ static int sPokeEvent;
nsAppShell::~nsAppShell()
{
#ifdef MOZ_IPC
if (sQApp)
delete sQApp;
sQApp = nsnull;
#endif
}
nsresult
@ -95,12 +83,6 @@ nsAppShell::Init()
sPokeEvent = QEvent::User+5000;
#endif
#ifdef MOZ_IPC
if (!qApp) {
sQApp = new QApplication(gArgc, (char**)gArgv);
}
#endif
return nsBaseAppShell::Init();
}