diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2004-01-27 20:48:55 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2004-01-27 20:48:55 +0800 |
commit | 7c0b959f0387ff24b16ef566813e61bdd9734705 (patch) | |
tree | c3436fcc81d49d968599693021f9ccf70baee955 /embed | |
parent | c3d6773d571a32552753d4284063d5b5056e649b (diff) | |
download | gsoc2013-epiphany-7c0b959f0387ff24b16ef566813e61bdd9734705.tar gsoc2013-epiphany-7c0b959f0387ff24b16ef566813e61bdd9734705.tar.gz gsoc2013-epiphany-7c0b959f0387ff24b16ef566813e61bdd9734705.tar.bz2 gsoc2013-epiphany-7c0b959f0387ff24b16ef566813e61bdd9734705.tar.lz gsoc2013-epiphany-7c0b959f0387ff24b16ef566813e61bdd9734705.tar.xz gsoc2013-epiphany-7c0b959f0387ff24b16ef566813e61bdd9734705.tar.zst gsoc2013-epiphany-7c0b959f0387ff24b16ef566813e61bdd9734705.zip |
Make sure to not initialize EphyBrowser multiple times.
2004-01-27 Marco Pesenti Gritti <marco@gnome.org>
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EphyBrowser.h:
Make sure to not initialize EphyBrowser
multiple times.
Diffstat (limited to 'embed')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 7 | ||||
-rw-r--r-- | embed/mozilla/EphyBrowser.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index cd6d18f7c..4f8e31246 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -190,7 +190,8 @@ EphyBrowser::EphyBrowser () { mFaviconEventListener = nsnull; mPopupEventListener = nsnull; - mEventReceiver = nsnull; + mEventReceiver = nsnull; + mInitialized = PR_FALSE; } EphyBrowser::~EphyBrowser () @@ -201,6 +202,8 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed) { nsresult rv; + if (mInitialized) return NS_OK; + gtk_moz_embed_get_nsIWebBrowser (mozembed, getter_AddRefs(mWebBrowser)); NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE); @@ -228,6 +231,8 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed) rv = GetListener(); NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE); + mInitialized = PR_TRUE; + return AttachListeners(); } diff --git a/embed/mozilla/EphyBrowser.h b/embed/mozilla/EphyBrowser.h index 40101ce44..0f3a89d85 100644 --- a/embed/mozilla/EphyBrowser.h +++ b/embed/mozilla/EphyBrowser.h @@ -130,6 +130,7 @@ private: nsCOMPtr<nsIDOMWindow> mDOMWindow; EphyFaviconEventListener *mFaviconEventListener; EphyPopupEventListener *mPopupEventListener; + PRBool mInitialized; nsresult GetListener (void); nsresult AttachListeners (void); |