aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-05-16 00:21:44 +0800
committerChristian Persch <chpe@src.gnome.org>2004-05-16 00:21:44 +0800
commitd4f9632a7f0086ba17d23893a41a1fb6e7ed29ef (patch)
tree1c84dfb3c867be3deeb45d6a1172ebee93b1948f /embed
parentffac6f64cb8909cbec7838374c998def6e076e8a (diff)
downloadgsoc2013-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.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/EphyBrowser.cpp14
1 files changed, 8 insertions, 6 deletions
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;