aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-29 07:52:49 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-29 07:52:49 +0800
commit515526399a7f11480c4077c55cdde9c5a796aca4 (patch)
treefc584d1f1f9b40209b65573fe51263353fbd8e67
parentb2160774063d686ed8fa744da1bd8df45c2e1ea8 (diff)
downloadgsoc2013-epiphany-515526399a7f11480c4077c55cdde9c5a796aca4.tar
gsoc2013-epiphany-515526399a7f11480c4077c55cdde9c5a796aca4.tar.gz
gsoc2013-epiphany-515526399a7f11480c4077c55cdde9c5a796aca4.tar.bz2
gsoc2013-epiphany-515526399a7f11480c4077c55cdde9c5a796aca4.tar.lz
gsoc2013-epiphany-515526399a7f11480c4077c55cdde9c5a796aca4.tar.xz
gsoc2013-epiphany-515526399a7f11480c4077c55cdde9c5a796aca4.tar.zst
gsoc2013-epiphany-515526399a7f11480c4077c55cdde9c5a796aca4.zip
Emit the changed signal before unrefing the persist object. The changed
2003-06-29 Marco Pesenti Gritti <marco@it.gnome.org> * embed/ephy-favicon-cache.c: (favicon_download_completed_cb), (ephy_favicon_cache_download), (ephy_favicon_cache_get): Emit the changed signal before unrefing the persist object. The changed url is set_data_full on it and it will be freed otherwise. Make sure we never emit signals with NULL url.
-rw-r--r--ChangeLog10
-rw-r--r--embed/ephy-favicon-cache.c13
2 files changed, 18 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 16b9e0f33..9ecfebbcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-06-29 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * embed/ephy-favicon-cache.c: (favicon_download_completed_cb),
+ (ephy_favicon_cache_download), (ephy_favicon_cache_get):
+
+ Emit the changed signal before unrefing the persist object.
+ The changed url is set_data_full on it and it will be freed
+ otherwise.
+ Make sure we never emit signals with NULL url.
+
2003-06-28 Piers Cornwell <piersc@cogs.susx.ac.uk>
* embed/downloader-view.c: (downloader_view_add_download):
diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c
index c2475cd41..f5a7f8c77 100644
--- a/embed/ephy-favicon-cache.c
+++ b/embed/ephy-favicon-cache.c
@@ -388,12 +388,13 @@ favicon_download_completed_cb (EphyEmbedPersist *persist,
{
char *url;
- url = g_object_get_data (G_OBJECT (persist), "url"),
+ url = g_object_get_data (G_OBJECT (persist), "url");
+ g_return_if_fail (url != NULL);
+
+ g_signal_emit (G_OBJECT (cache), ephy_favicon_cache_signals[CHANGED], 0, url);
g_hash_table_remove (cache->priv->downloads_hash, url);
g_object_unref (persist);
-
- g_signal_emit (G_OBJECT (cache), ephy_favicon_cache_signals[CHANGED], 0, url);
}
static void
@@ -429,10 +430,10 @@ ephy_favicon_cache_download (EphyFaviconCache *cache,
G_CALLBACK (favicon_download_completed_cb),
cache);
- ephy_embed_persist_save (persist);
-
g_hash_table_insert (cache->priv->downloads_hash,
g_strdup (favicon_url), persist);
+
+ ephy_embed_persist_save (persist);
}
GdkPixbuf *
@@ -445,6 +446,8 @@ ephy_favicon_cache_get (EphyFaviconCache *cache,
char *pix_file;
GdkPixbuf *pixbuf;
+ if (url == NULL) return NULL;
+
now = time (NULL);
g_static_rw_lock_reader_lock (cache->priv->icons_hash_lock);