about summary refs log tree commit diff stats
path: root/xxxterm.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-01-17 21:07:15 +0000
committerMarco Peereboom <marco@conformal.com>2011-01-17 21:07:15 +0000
commitee63ff8ac3d74a55dbbf91cc2a5345cf8e4d854d (patch)
tree2a89c931851b9d4ad38cd21b07500d21b202922a /xxxterm.c
parent1b9ab3618ebc5021e9bd9df6fc7a871bf9b922e0 (diff)
downloadxombrero-ee63ff8ac3d74a55dbbf91cc2a5345cf8e4d854d.tar.gz
fix (i hope the last crash with favicon) by not freeing the download when
canceled.  the docs seem to be lying about it not being freed.
Diffstat (limited to 'xxxterm.c')
-rw-r--r--xxxterm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 2fc7173..4e1bd51 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -4643,11 +4643,9 @@ abort_favicon_download(struct tab *t)
 {
 	DNPRINTF(XT_D_DOWNLOAD, "%s: down %p\n", __func__, t->icon_download);
 
-	if (t->icon_download) {
+	if (t->icon_download)
 		webkit_download_cancel(t->icon_download);
-		g_object_unref(t->icon_download);
-		t->icon_download = NULL;
-	} else
+	else
 		free_favicon(t);
 
 	gtk_entry_set_icon_from_icon_name(GTK_ENTRY(t->uri_entry),
@@ -4717,7 +4715,7 @@ void
 favicon_download_status_changed_cb(WebKitDownload *download, GParamSpec *spec,
     struct tab *t)
 {
-	WebKitDownloadStatus	status = webkit_download_get_status (download);
+	WebKitDownloadStatus	status = webkit_download_get_status(download);
 
 	if (t == NULL)
 		return;
@@ -4728,6 +4726,8 @@ favicon_download_status_changed_cb(WebKitDownload *download, GParamSpec *spec,
 	switch (status) {
 	case WEBKIT_DOWNLOAD_STATUS_ERROR:
 		/* -1 */
+		t->icon_download = NULL;
+		free_favicon(t);
 		break;
 	case WEBKIT_DOWNLOAD_STATUS_CREATED:
 		/* 0 */
@@ -4739,6 +4739,7 @@ favicon_download_status_changed_cb(WebKitDownload *download, GParamSpec *spec,
 		/* 2 */
 		DNPRINTF(XT_D_DOWNLOAD, "%s: freeing favicon %d\n",
 		    __func__, t->tab_id);
+		t->icon_download = NULL;
 		free_favicon(t);
 		break;
 	case WEBKIT_DOWNLOAD_STATUS_FINISHED: