mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 554008 - QApplication init must be initialized in ContentProcessChild, not in TabChild. r=smaug
This commit is contained in:
parent
69b885991b
commit
bff94e11ae
@ -36,6 +36,10 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#include <QApplication>
|
||||
#endif
|
||||
|
||||
#include "ContentProcessChild.h"
|
||||
#include "TabChild.h"
|
||||
|
||||
@ -50,6 +54,11 @@
|
||||
using namespace mozilla::ipc;
|
||||
using namespace mozilla::net;
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
extern int gArgc;
|
||||
extern char **gArgv;
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
@ -58,6 +67,10 @@ ContentProcessChild* ContentProcessChild::sSingleton;
|
||||
ContentProcessChild::ContentProcessChild()
|
||||
: mQuit(PR_FALSE)
|
||||
{
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
NS_ASSERTION(!qApp, "QApplication created too early?");
|
||||
mQApp = new QApplication(gArgc, (char**)gArgv);
|
||||
#endif
|
||||
}
|
||||
|
||||
ContentProcessChild::~ContentProcessChild()
|
||||
|
@ -44,6 +44,10 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
class QApplication;
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
@ -83,6 +87,9 @@ private:
|
||||
nsTArray<nsAutoPtr<PTestShellChild> > mTestShells;
|
||||
|
||||
PRBool mQuit;
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
nsAutoPtr<QApplication> mQApp;
|
||||
#endif
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(ContentProcessChild);
|
||||
};
|
||||
|
@ -69,7 +69,6 @@
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#include <QX11EmbedWidget>
|
||||
#include <QApplication>
|
||||
#include <QGraphicsView>
|
||||
#include <QGraphicsWidget>
|
||||
#endif
|
||||
@ -81,12 +80,6 @@
|
||||
|
||||
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
|
||||
@ -109,9 +102,6 @@ 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);
|
||||
@ -357,11 +347,6 @@ TabChild::destroyWidget()
|
||||
|
||||
TabChild::~TabChild()
|
||||
{
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
if (gQApp)
|
||||
delete gQApp;
|
||||
gQApp = nsnull;
|
||||
#endif
|
||||
destroyWidget();
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(mWebNav);
|
||||
if (webBrowser) {
|
||||
|
Loading…
Reference in New Issue
Block a user