]> git.street.me.uk Git - andy/viking.git/commitdiff
Fix #2977752 : win-gtk: osm tiles don't show up
authorMathieu Albinet <mathieu17@gmail.com>
Wed, 19 May 2010 19:46:38 +0000 (21:46 +0200)
committerGuilhem Bonnefille <guilhem.bonnefille@gmail.com>
Wed, 19 May 2010 19:46:38 +0000 (21:46 +0200)
It's a Windows specific bug (should I say glib specific behaviour on Windows).

src/download.c

index 9c6f42555f77e32ac7efe0a6b3a3a53dbaa20df5..1c7711b9fe067978e12f8dd5602b33e9f18fcaca 100644 (file)
@@ -198,14 +198,15 @@ static int download( const char *hostname, const char *uri, const char *fn, Down
     failure = TRUE;
   }
 
+  fclose ( f );
+  f = NULL;
+
   if (failure)
   {
     g_warning(_("Download error: %s"), fn);
     g_remove ( tmpfilename );
     unlock_file ( tmpfilename );
     g_free ( tmpfilename );
-    fclose ( f );
-    f = NULL;
     g_remove ( fn ); /* couldn't create temporary. delete 0-byte file. */
     return -1;
   }
@@ -221,8 +222,7 @@ static int download( const char *hostname, const char *uri, const char *fn, Down
     g_rename ( tmpfilename, fn ); /* move completely-downloaded file to permanent location */
   unlock_file ( tmpfilename );
   g_free ( tmpfilename );
-  fclose ( f );
-  f = NULL;
+
   return 0;
 }