From ee63ff8ac3d74a55dbbf91cc2a5345cf8e4d854d Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Mon, 17 Jan 2011 21:07:15 +0000 Subject: 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. --- xxxterm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'xxxterm.c') 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: -- cgit 1.4.1-2-gfad0