aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-03-11 19:25:08 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-03-11 19:25:08 +0800
commit666fda707688a305a0ca16a698868e6983824803 (patch)
tree489d1b5b1fda3e76102d371efe0e8e98443c3012
parentb072eb8810a82ef0faa6d6b67f47e24b3d974ff4 (diff)
downloadgsoc2013-epiphany-666fda707688a305a0ca16a698868e6983824803.tar
gsoc2013-epiphany-666fda707688a305a0ca16a698868e6983824803.tar.gz
gsoc2013-epiphany-666fda707688a305a0ca16a698868e6983824803.tar.bz2
gsoc2013-epiphany-666fda707688a305a0ca16a698868e6983824803.tar.lz
gsoc2013-epiphany-666fda707688a305a0ca16a698868e6983824803.tar.xz
gsoc2013-epiphany-666fda707688a305a0ca16a698868e6983824803.tar.zst
gsoc2013-epiphany-666fda707688a305a0ca16a698868e6983824803.zip
weak ref the dialog (from galeon)
2003-03-11 Marco Pesenti Gritti <marco@it.gnome.org> * embed/mozilla/ProgressListener.cpp: weak ref the dialog (from galeon)
-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;