]> git.street.me.uk Git - andy/viking.git/commitdiff
Fix memory leak on re-downloading 'bad' map image tiles.
authorRob Norris <rw_norris@hotmail.com>
Thu, 29 Jun 2017 18:31:53 +0000 (19:31 +0100)
committerRob Norris <rw_norris@hotmail.com>
Thu, 29 Jun 2017 18:32:57 +0000 (19:32 +0100)
src/vikmapslayer.c

index 38af8c9d00b86fee4dcb7ed5a992d8ca1007ab86..000ba8e85342cd406e4fbcf2316da1d2cb6732d7 100644 (file)
@@ -2265,10 +2265,11 @@ static gint maps_layer_how_many_maps ( VikMapsLayer *vml, VikViewport *vvp, VikC
             else {
               if ( mdi->redownload == REDOWNLOAD_BAD ) {
                 /* see if this one is bad or what */
-                GError *gx = NULL;
-                GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file ( mdi->filename_buf, &gx );
-                if (gx || (!pixbuf)) {
+                GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file ( mdi->filename_buf, NULL );
+                if ( !pixbuf ) {
                   mdi->mapstoget++;
+                } else {
+                  g_object_unref ( pixbuf );
                 }
                 break;
                 // Other download cases already considered or just ignored