aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--embed/downloader-view.c9
-rw-r--r--embed/mozilla/MozDownload.cpp4
-rw-r--r--embed/mozilla/mozilla-download.cpp6
4 files changed, 32 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c13162bac..439444667 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
2004-03-03 Christian Persch <chpe@cvs.gnome.org>
+ * embed/downloader-view.c: (download_dialog_pause_cb),
+ (download_dialog_abort_cb):
+
+ Unset the GValue after we're done using what it contained.
+
+ * embed/mozilla/MozDownload.cpp:
+
+ Weak ref mEphyDownload, and assert that is has been finalised by the time
+ we get to ~MozDownload.
+
+ * embed/mozilla/mozilla-download.cpp:
+
+ Debug output in _init and _finalize.
+
+2004-03-03 Christian Persch <chpe@cvs.gnome.org>
+
* src/bookmarks/ephy-bookmark-action.c: (favicon_cache_changed_cb),
(ephy_bookmark_action_sync_icon), (ephy_bookmark_action_init):
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 38360f089..735d808bf 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -575,7 +575,6 @@ download_dialog_pause_cb (GtkButton *button, DownloaderView *dv)
gtk_tree_model_get_value (model, &iter, COL_DOWNLOAD_OBJECT, &val);
download = g_value_get_object (&val);
- g_value_unset (&val);
state = ephy_download_get_state (download);
@@ -587,6 +586,9 @@ download_dialog_pause_cb (GtkButton *button, DownloaderView *dv)
{
ephy_download_resume (download);
}
+
+ g_value_unset (&val);
+
update_buttons (dv);
}
@@ -670,11 +672,12 @@ download_dialog_abort_cb (GtkButton *button, DownloaderView *dv)
gtk_tree_model_get_value (model, &iter, COL_DOWNLOAD_OBJECT, &val);
download = g_value_get_object (&val);
- g_value_unset (&val);
g_return_if_fail (download != NULL);
-
+
ephy_download_cancel ((EphyDownload*)download);
downloader_view_remove_download (dv, download);
+
+ g_value_unset (&val);
}
gboolean
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index f2877ce9b..f65ed2bd2 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -76,6 +76,8 @@ MozDownload::MozDownload() :
MozDownload::~MozDownload()
{
LOG ("MozDownload dtor (%p)", (void *) this)
+
+ NS_ASSERTION (!mEphyDownload, "MozillaDownload still alive!");
}
NS_IMPL_ISUPPORTS2(MozDownload, nsIDownload, nsIWebProgressListener)
@@ -129,6 +131,8 @@ MozDownload::Init(nsIURI *aSource, nsILocalFile *aTarget, const PRUnichar *aDisp
dview = EPHY_DOWNLOADER_VIEW
(ephy_embed_shell_get_downloader_view (embed_shell));
mEphyDownload = mozilla_download_new (this);
+ g_object_add_weak_pointer (G_OBJECT (mEphyDownload),
+ (gpointer *) &mEphyDownload);
downloader_view_add_download (dview, mEphyDownload);
g_object_unref (mEphyDownload);
}
diff --git a/embed/mozilla/mozilla-download.cpp b/embed/mozilla/mozilla-download.cpp
index 71ed74874..8405ba29d 100644
--- a/embed/mozilla/mozilla-download.cpp
+++ b/embed/mozilla/mozilla-download.cpp
@@ -24,6 +24,8 @@
#include "mozilla-download.h"
+#include "ephy-debug.h"
+
#include "nsString.h"
static void
@@ -198,6 +200,8 @@ mozilla_download_finalize (GObject *object)
NS_RELEASE (download->priv->moz_download);
+ LOG ("MozillaDownload %p finalised", object)
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -273,6 +277,8 @@ mozilla_download_class_init (MozillaDownloadClass *klass)
static void
mozilla_download_init (MozillaDownload *download)
{
+ LOG ("MozillaDownload %p initialising", download)
+
download->priv = MOZILLA_DOWNLOAD_GET_PRIVATE (download);
}