aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed-single.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-06-27 19:53:34 +0800
committerChristian Persch <chpe@src.gnome.org>2004-06-27 19:53:34 +0800
commitcc2e070cb399d4581df590127f964add66aa0124 (patch)
tree9ec6e8cf47225097979ddafa37d25f8f025e24d5 /embed/mozilla/mozilla-embed-single.cpp
parente497b299846293f001ad98f2b7dca3e68db2bf26 (diff)
downloadgsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.tar.gz
gsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.tar.zst
gsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.zip
EphySingle needs to implement nsISupportsWeakReference.
2004-06-27 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphySingle.cpp: * embed/mozilla/EphySingle.h: * embed/mozilla/mozilla-embed-single.cpp: EphySingle needs to implement nsISupportsWeakReference. 2004-06-26 Christian Persch <chpe@cvs.gnome.org>
Diffstat (limited to 'embed/mozilla/mozilla-embed-single.cpp')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 33f14737e..5882b3fae 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -414,18 +414,21 @@ mozilla_init_chrome (void)
static void
mozilla_init_observer (MozillaEmbedSingle *single)
{
- EphySingle *observer;
+ EphySingle *es;
- observer = new EphySingle ();
+ es = new EphySingle ();
+ nsCOMPtr<nsIObserver> guard = NS_STATIC_CAST (nsIObserver *, es);
+ if (!guard) return;
- if (observer)
+ nsresult rv;
+ rv = es->Init (EPHY_EMBED_SINGLE (single));
+ if (NS_FAILED (rv))
{
- nsresult rv;
- rv = observer->Init (EPHY_EMBED_SINGLE (single));
- if (NS_FAILED (rv)) return;
-
- NS_ADDREF (single->priv->mSingleObserver = observer);
+ g_warning ("Failed to initialise EphySingle!\n");
+ return;
}
+
+ NS_ADDREF (single->priv->mSingleObserver = es);
}
static gboolean
@@ -506,6 +509,7 @@ mozilla_embed_single_dispose (GObject *object)
{
single->priv->mSingleObserver->Detach ();
NS_RELEASE (single->priv->mSingleObserver);
+ delete single->priv->mSingleObserver;
single->priv->mSingleObserver = nsnull;
}
}