diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | embed/ephy-favicon-cache.c | 13 |
2 files changed, 18 insertions, 5 deletions
@@ -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); |