diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-07-25 19:06:43 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-07-25 19:06:43 +0800 |
commit | 2fc0f613b6289f4e3293de5737e41c1a016d9a17 (patch) | |
tree | 492e029ae0bc151f31e2f66e4816b87f93cbe98c | |
parent | 4d5573ce58ca2e26b50c3dafcfe93f597d383fa2 (diff) | |
download | gsoc2013-epiphany-2fc0f613b6289f4e3293de5737e41c1a016d9a17.tar gsoc2013-epiphany-2fc0f613b6289f4e3293de5737e41c1a016d9a17.tar.gz gsoc2013-epiphany-2fc0f613b6289f4e3293de5737e41c1a016d9a17.tar.bz2 gsoc2013-epiphany-2fc0f613b6289f4e3293de5737e41c1a016d9a17.tar.lz gsoc2013-epiphany-2fc0f613b6289f4e3293de5737e41c1a016d9a17.tar.xz gsoc2013-epiphany-2fc0f613b6289f4e3293de5737e41c1a016d9a17.tar.zst gsoc2013-epiphany-2fc0f613b6289f4e3293de5737e41c1a016d9a17.zip |
Release the single observer in dispose. Should fix bug #146873.
2004-07-25 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphySingle.cpp:
* embed/mozilla/mozilla-embed-single.cpp:
Release the single observer in dispose.
Should fix bug #146873.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | embed/mozilla/EphySingle.cpp | 1 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 25 |
3 files changed, 30 insertions, 4 deletions
@@ -1,3 +1,11 @@ +2004-07-25 Christian Persch <chpe@cvs.gnome.org> + + * embed/mozilla/EphySingle.cpp: + * embed/mozilla/mozilla-embed-single.cpp: + + Release the single observer in dispose. + Should fix bug #146873. + 2004-07-24 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/mozilla-embed.cpp: diff --git a/embed/mozilla/EphySingle.cpp b/embed/mozilla/EphySingle.cpp index 96a6fc8eb..3d5ae18ff 100644 --- a/embed/mozilla/EphySingle.cpp +++ b/embed/mozilla/EphySingle.cpp @@ -79,7 +79,6 @@ EphySingle::~EphySingle() { LOG ("EphySingle destructor") - Detach(); mOwner = nsnull; } diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 914213438..9a32ab3b0 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -422,11 +422,16 @@ mozilla_init_chrome (void) static void mozilla_init_observer (MozillaEmbedSingle *single) { - single->priv->mSingleObserver = new EphySingle (); + EphySingle *es; - if (single->priv->mSingleObserver) + es = new EphySingle (); + NS_ADDREF (single->priv->mSingleObserver = es); + + nsresult rv; + rv = es->Init (EPHY_EMBED_SINGLE (single)); + if (NS_FAILED (rv)) { - single->priv->mSingleObserver->Init (EPHY_EMBED_SINGLE (single)); + g_warning ("Failed to initialised EphySingle!\n"); } } @@ -500,6 +505,19 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes) } static void +mozilla_embed_single_dispose (GObject *object) +{ + MozillaEmbedSingle *single = MOZILLA_EMBED_SINGLE (object); + + if (single->priv->mSingleObserver) + { + single->priv->mSingleObserver->Detach (); + NS_RELEASE (single->priv->mSingleObserver); + single->priv->mSingleObserver = nsnull; + } +} + +static void mozilla_embed_single_finalize (GObject *object) { MozillaEmbedSingle *mes = MOZILLA_EMBED_SINGLE (object); @@ -885,6 +903,7 @@ mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass) parent_class = (GObjectClass *) g_type_class_peek_parent (klass); + object_class->dispose = mozilla_embed_single_dispose; object_class->finalize = mozilla_embed_single_finalize; g_type_class_add_private (object_class, sizeof (MozillaEmbedSinglePrivate)); |