aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--embed/mozilla/ProgressListener.cpp32
2 files changed, 27 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 8027a3e40..fd1f3d06a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-11 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * embed/mozilla/ProgressListener.cpp:
+
+ weak ref the dialog (from galeon)
+
2003-03-10 Marco Pesenti Gritti <marco@it.gnome.org>
* data/glade/prefs-dialog.glade:
diff --git a/embed/mozilla/ProgressListener.cpp b/embed/mozilla/ProgressListener.cpp
index 039e9af40..bfd6c7d7d 100644
--- a/embed/mozilla/ProgressListener.cpp
+++ b/embed/mozilla/ProgressListener.cpp
@@ -64,7 +64,11 @@ GProgressListener::GProgressListener () : mLauncher(nsnull),
GProgressListener::~GProgressListener ()
{
- /* destructor code */
+ if (mDownloaderView)
+ {
+ g_object_remove_weak_pointer (G_OBJECT (mDownloaderView),
+ (void **) &mDownloaderView);
+ }
}
NS_METHOD GProgressListener::InitForPersist (nsIWebBrowserPersist *aPersist,
@@ -149,7 +153,7 @@ NS_METHOD GProgressListener::PrivateInit (void)
mElapsed = now - mStartTime;
- if (!mNoDialog)
+ if (!mNoDialog && mDownloaderView)
{
gchar *filename, *source, *dest;
nsAutoString uTmp;
@@ -179,6 +183,9 @@ NS_METHOD GProgressListener::PrivateInit (void)
G_CALLBACK (download_resume_cb),
this);
mDownloaderView = dv;
+
+ g_object_add_weak_pointer (G_OBJECT (mDownloaderView),
+ (void **) &mDownloaderView);
}
/* done */
@@ -513,15 +520,18 @@ NS_IMETHODIMP GProgressListener::
/currentRate +.5);
}
- downloader_view_set_download_progress (mDownloaderView,
- mElapsed,
- remaining,
- speed,
- totalKBytes,
- currentKBytes,
- progress,
- mCanPause,
- (gpointer)this);
+ if (mDownloaderView)
+ {
+ downloader_view_set_download_progress (mDownloaderView,
+ mElapsed,
+ remaining,
+ speed,
+ totalKBytes,
+ currentKBytes,
+ progress,
+ mCanPause,
+ (gpointer)this);
+ }
/* done */
return NS_OK;