From: Emmanuel Rodriguez Date: Sun, 26 Apr 2009 11:18:31 +0000 (+0200) Subject: Memory leak fix: file_loaded_cb() now frees the actor if there's an error X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b31507f6963af7d606a7d53cdecb5b3197276d1f;p=libchamplain Memory leak fix: file_loaded_cb() now frees the actor if there's an error --- diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c index c916fb8..54c7d6a 100644 --- a/champlain/champlain-network-map-source.c +++ b/champlain/champlain-network-map-source.c @@ -470,8 +470,8 @@ file_loaded_cb (SoupSession *session, return; } */ - GdkPixbuf* pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); - ClutterActor *actor = clutter_texture_new(); + GdkPixbuf* pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); + ClutterActor *actor = clutter_texture_new (); if (!clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (actor), gdk_pixbuf_get_pixels (pixbuf), gdk_pixbuf_get_has_alpha (pixbuf), @@ -482,12 +482,13 @@ file_loaded_cb (SoupSession *session, gdk_pixbuf_get_n_channels (pixbuf) / 8, 0, &error)) { - g_print("BPP: %d", gdk_pixbuf_get_bits_per_sample (pixbuf)); + g_print ("BPP: %d", gdk_pixbuf_get_bits_per_sample (pixbuf)); if (error) { g_warning ("Unable to transfer to clutter: %s", error->message); g_error_free (error); create_error_tile (ctx->tile); + g_object_unref (actor); goto cleanup; } }