Changeset 5267 for anuga_work/development/anugavis/src/init.c
- Timestamp:
- May 2, 2008, 12:13:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/src/init.c
r5264 r5267 20 20 #include "error.h" 21 21 #include "globals.h" 22 #include "init.h" 22 23 #include "netcdf_util.h" 23 #include "x malloc.h"24 #include "xfunctions.h" 24 25 25 26 int AnugaVis_Init(int width, int height, const char *swwFilePath){ … … 43 44 } 44 45 46 SDL_WM_SetCaption("ANUGA Visualiser", "ANUGA Visualiser"); 45 47 glEnable(GL_DEPTH_TEST); 46 48 glShadeModel(GL_FLAT); … … 63 65 (nc_inq_dimlen_by_name(anugavis.netcdfId, "number_of_volumes", 64 66 &anugavis.number_of_volumes) != NC_NOERR) || 67 (nc_inq_dimlen_by_name(anugavis.netcdfId, "number_of_timesteps", 68 &anugavis.number_of_timesteps) != NC_NOERR) || 65 69 ((anugavis.x = xmalloc(sizeof(float) * anugavis.number_of_points, 66 70 "AnugaVis_Init()")) == NULL) || … … 77 81 (nc_get_var_int_by_name(anugavis.netcdfId, "volumes", 78 82 anugavis.volumes) != NC_NOERR)){ 79 nc_close(anugavis.netcdfId); 80 if(anugavis.x != NULL) free(anugavis.x); 81 if(anugavis.y != NULL) free(anugavis.y); 82 if(anugavis.volumes != NULL) free(anugavis.volumes); 83 SDL_Quit(); 83 AnugaVis_DeInit(); 84 84 return -1; 85 85 } … … 91 91 AnugaVis_UndefineHeightQuantity(anugavis.heights->name); 92 92 nc_close(anugavis.netcdfId); 93 free(anugavis.x);94 free(anugavis.y);95 free(anugavis.volumes);93 if(anugavis.x != NULL) free(anugavis.x); 94 if(anugavis.y != NULL) free(anugavis.y); 95 if(anugavis.volumes != NULL) free(anugavis.volumes); 96 96 SDL_Quit(); 97 97 }
Note: See TracChangeset
for help on using the changeset viewer.