[epiphany] downloader-view: properly disconnect signals



commit 3d46002e19d94a38d53754d303a27bc8630e1a4e
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Tue Mar 2 20:05:23 2010 -0500

    downloader-view: properly disconnect signals
    
    The previous code wasn't disconnecting signals at all.
    
    Bug #611779

 embed/downloader-view.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 0ec3210..27f1c59 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -124,6 +124,18 @@ static void
 show_notification_window (DownloaderView *dv);
 #endif
 
+static void
+download_progress_cb (WebKitDownload *download,
+		      GParamSpec *pspec,
+		      DownloaderView *dv);
+static void
+download_status_changed_cb (WebKitDownload *download,
+			    GParamSpec *pspec,
+			    DownloaderView *dv);
+static gboolean
+download_error_cb (WebKitDownload *download, gint error_code, gint error_detail,
+		   const gchar *reason, DownloaderView *dv);
+
 G_DEFINE_TYPE (DownloaderView, downloader_view, EPHY_TYPE_DIALOG)
 
 static void
@@ -195,13 +207,18 @@ show_status_icon (DownloaderView *dv)
 static gboolean
 remove_download (WebKitDownload *download,
 		 gpointer rowref,
-		 DownloaderView *view)
+		 DownloaderView *dv)
 {
 	WebKitDownloadStatus status;
 
-	g_signal_handlers_disconnect_matched
-		(download, G_SIGNAL_MATCH_DATA,
-		 0, 0, NULL, NULL, view);
+	g_signal_handlers_disconnect_by_func
+		(download, G_CALLBACK (download_progress_cb), dv);
+
+	g_signal_handlers_disconnect_by_func
+		(download, G_CALLBACK (download_status_changed_cb), dv);
+
+	g_signal_handlers_disconnect_by_func
+		(download, G_CALLBACK (download_error_cb), dv);
 
 	status = webkit_download_get_status (download);
 	if (status == WEBKIT_DOWNLOAD_STATUS_STARTED)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]