diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-05-16 00:21:44 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-05-16 00:21:44 +0800 |
commit | d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef (patch) | |
tree | 1c84dfb3c867be3deeb45d6a1172ebee93b1948f | |
parent | ffac6f64cb8909cbec7838374c998def6e076e8a (diff) | |
download | gsoc2013-epiphany-d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef.tar gsoc2013-epiphany-d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef.tar.gz gsoc2013-epiphany-d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef.tar.bz2 gsoc2013-epiphany-d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef.tar.lz gsoc2013-epiphany-d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef.tar.xz gsoc2013-epiphany-d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef.tar.zst gsoc2013-epiphany-d4f9632a7f0086ba17d23893a41a1fb6e7ed29ef.zip |
Set mEventReceiver to nsnull in ::Destroy(), fixes a crasher.
2004-05-15 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyBrowser.cpp:
Set mEventReceiver to nsnull in ::Destroy(), fixes a crasher.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 14 |
2 files changed, 14 insertions, 6 deletions
@@ -1,3 +1,9 @@ +2004-05-15 Christian Persch <chpe@cvs.gnome.org> + + * embed/mozilla/EphyBrowser.cpp: + + Set mEventReceiver to nsnull in ::Destroy(), fixes a crasher. + 2004-05-14 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyContentPolicy.cpp: diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index af0702ba1..901a98b29 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -78,9 +78,9 @@ #endif EphyEventListener::EphyEventListener(void) +: mOwner(nsnull) { LOG ("EphyEventListener ctor (%p)", this) - mOwner = nsnull; } EphyEventListener::~EphyEventListener() @@ -164,10 +164,10 @@ EphyFaviconEventListener::HandleEvent(nsIDOMEvent* aDOMEvent) } EphyBrowser::EphyBrowser () +: mFaviconEventListener(nsnull) +, mPopupEventListener(nsnull) +, mInitialized(PR_FALSE) { - mFaviconEventListener = nsnull; - mEventReceiver = nsnull; - mInitialized = PR_FALSE; } EphyBrowser::~EphyBrowser () @@ -256,10 +256,11 @@ EphyBrowser::DetachListeners(void) { nsresult rv; - NS_ENSURE_TRUE (mEventReceiver, NS_ERROR_FAILURE); - + if (!mEventReceiver) return NS_OK; + nsCOMPtr<nsIDOMEventTarget> target; target = do_QueryInterface (mEventReceiver); + NS_ENSURE_TRUE (target, NS_ERROR_FAILURE); rv = target->RemoveEventListener(NS_LITERAL_STRING("DOMLinkAdded"), mFaviconEventListener, PR_FALSE); @@ -365,6 +366,7 @@ nsresult EphyBrowser::Destroy () mWebBrowser = nsnull; mDOMWindow = nsnull; + mEventReceiver = nsnull; mInitialized = PR_FALSE; |