Browse Source

r.in.gdal: close GDALDataset; G_done_msg() when we are really done

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52268 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 13 years ago
parent
commit
563e7ea923
1 changed files with 6 additions and 1 deletions
  1. 6 1
      raster/r.in.gdal/main.c

+ 6 - 1
raster/r.in.gdal/main.c

@@ -615,6 +615,9 @@ int main(int argc, char *argv[])
 	}
 	}
     }
     }
 
 
+    /* close the GDALDataset to avoid segfault in libgdal */
+    GDALClose(hDS);
+
     /* -------------------------------------------------------------------- */
     /* -------------------------------------------------------------------- */
     /*      Extend current window based on dataset.                         */
     /*      Extend current window based on dataset.                         */
     /* -------------------------------------------------------------------- */
     /* -------------------------------------------------------------------- */
@@ -647,6 +650,8 @@ int main(int argc, char *argv[])
 	G_message(_("Region for the current mapset updated"));
 	G_message(_("Region for the current mapset updated"));
     }
     }
 
 
+    G_done_msg(" ");
+
     exit(EXIT_SUCCESS);
     exit(EXIT_SUCCESS);
 }
 }
 
 
@@ -979,7 +984,7 @@ static void ImportBand(GDALRasterBandH hBand, const char *output,
 	}
 	}
     }
     }
 
 
-    G_done_msg(_("Raster map <%s> created."), output);
+    G_message(_("Raster map <%s> created."), output);
 
 
     return;
     return;
 }
 }