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 | |
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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 7 | ||||
-rw-r--r-- | embed/mozilla/EphyBrowser.h | 1 |
3 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,11 @@ +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. + 2004-01-26 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-download.c: (ephy_download_get_name): 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); |