diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-06-27 19:53:34 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-06-27 19:53:34 +0800 |
commit | cc2e070cb399d4581df590127f964add66aa0124 (patch) | |
tree | 9ec6e8cf47225097979ddafa37d25f8f025e24d5 /embed/mozilla/mozilla-embed-single.cpp | |
parent | e497b299846293f001ad98f2b7dca3e68db2bf26 (diff) | |
download | gsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.tar gsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.tar.gz gsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.tar.bz2 gsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.tar.lz gsoc2013-epiphany-cc2e070cb399d4581df590127f964add66aa0124.tar.xz 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.cpp | 20 |
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; } } |