diff options
author | Bruno Coudoin <bcoudoin@src.gnome.org> | 2006-10-09 21:04:26 (GMT) |
---|---|---|
committer | Bruno Coudoin <bcoudoin@src.gnome.org> | 2006-10-09 21:04:26 (GMT) |
commit | 712088d0003c9f34241e32e9fc653c82b72742d6 (patch) | |
tree | 97d85b4ced5ab286dca02ea02fd99b72680eb8ed /src/gcompris/gameutil.c | |
parent | 0b19f58475c4dee1dd9254b9fd7dbea1f7aed3b5 (diff) |
All memory leaks fixed by Miguel DE IZARRA (miguel2i)
* Makefile.mingw.in: removed deprecated assetml files
* boards/flags/Makefile.am: cleanup
* boards/flags/README: updated image source
* boards/gcompris_pixmaps.assetml.in: removed, no more needed
* src/boards/chess.c: (chess_create_item): fixed leak
* src/boards/machpuzzle.c: (minigolf_destroy_all_items): fixed leak
* src/boards/maze.c: (twoDdisplay): fixed leak
* src/boards/menu2.c: (create_top): fixed leak
* src/boards/python/electric.py: added windows support
* src/boards/shapegame.c: (destroy_shape), (xmlGetProp_Double),
(add_xml_shape_to_data): fixed leak
* src/gcompris/bar.c: (gc_bar_start): no more show button by default
* src/gcompris/config.c: (gc_config_start), (item_event_ok): fixed leak
* src/gcompris/dialog.c: (gc_dialog): accept a dialog without a board running
this is usefull to display dialog at statup when we don't find a board at all
* src/gcompris/gameutil.c: (gc_file_find_absolute): fixed leak
* src/gcompris/gcompris.c: (gc_cursor_set), (setup_window),
(cleanup), (load_properties), (gc_init): memory leak, display a dialog now when
no board are found
* src/gcompris/menu.c: (_add_xml_to_data): fixed leak
* src/gcompris/properties.c: (gc_prop_new): fixed leak
* src/gcompris/skin.c: (gc_skin_free): fixed leak
Diffstat (limited to 'src/gcompris/gameutil.c')
-rw-r--r-- | src/gcompris/gameutil.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gcompris/gameutil.c b/src/gcompris/gameutil.c index a1e31f5..dad25de 100644 --- a/src/gcompris/gameutil.c +++ b/src/gcompris/gameutil.c @@ -507,8 +507,6 @@ gc_file_find_absolute(const gchar *format, ...) filename = g_strdup_vprintf (format, args); va_end (args); - g_warning("filename '%s'", filename); - /* Check it's already an absolute file */ if( ((g_path_is_absolute (filename) && g_file_test (filename, G_FILE_TEST_EXISTS)) @@ -543,14 +541,13 @@ gc_file_find_absolute(const gchar *format, ...) g_strlcpy(locale, gc_locale_get(), sizeof(locale)); filename2 = g_strjoinv(locale, tmp); absolute_filename = g_strdup_printf("%s/%s", dir_to_search[i], filename2); - g_warning("1>>>> trying %s\n", absolute_filename); if(g_file_test (absolute_filename, G_FILE_TEST_EXISTS)) { g_strfreev(tmp); g_free(filename2); goto FOUND; } - + g_free(absolute_filename); /* Now check if this file is on the net */ if((absolute_filename = gc_net_get_url_from_file(filename2, NULL))) { @@ -559,6 +556,8 @@ gc_file_find_absolute(const gchar *format, ...) goto FOUND; } + g_free(filename2); + g_free(absolute_filename); /* Try the short locale */ if(g_strv_length(tmp)>1) { @@ -566,7 +565,6 @@ gc_file_find_absolute(const gchar *format, ...) filename2 = g_strjoinv(locale, tmp); g_strfreev(tmp); absolute_filename = g_strdup_printf("%s/%s", dir_to_search[i], filename2); - g_warning("2>>>> trying %s\n", absolute_filename); if(g_file_test (absolute_filename, G_FILE_TEST_EXISTS)) { g_free(filename2); @@ -579,9 +577,11 @@ gc_file_find_absolute(const gchar *format, ...) g_free(filename2); goto FOUND; } - + g_free(filename2); } + else + g_strfreev(tmp); } else { @@ -589,10 +589,11 @@ gc_file_find_absolute(const gchar *format, ...) if(g_file_test (absolute_filename, G_FILE_TEST_EXISTS)) goto FOUND; - + g_free(absolute_filename); /* Now check if this file is on the net */ if((absolute_filename = gc_net_get_url_from_file(filename, NULL))) goto FOUND; + g_free(absolute_filename); } i++; |