Revision: 1364 http://svn.sourceforge.net/geany/?rev=1364&view=rev Author: ntrel Date: 2007-03-03 08:54:04 -0800 (Sat, 03 Mar 2007)
Log Message: ----------- Fix memory leak, remove unused build_create_shellscript() argument.
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-03-03 13:34:15 UTC (rev 1363) +++ trunk/ChangeLog 2007-03-03 16:54:04 UTC (rev 1364) @@ -5,6 +5,8 @@ temporary file from build_run_cmd() to prepare_run_script(). * src/build.c, src/utils.c: Fix memory leak with utils_remove_ext_from_filename(). + * src/build.c: + Fix memory leak, remove unused build_create_shellscript() argument.
2007-03-02 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2007-03-03 13:34:15 UTC (rev 1363) +++ trunk/src/build.c 2007-03-03 16:54:04 UTC (rev 1364) @@ -80,8 +80,7 @@
static gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data); -static gboolean build_create_shellscript(const gint idx, const gchar *fname, const gchar *cmd, - gboolean autoclose); +static gboolean build_create_shellscript(const gchar *fname, const gchar *cmd, gboolean autoclose); static GPid build_spawn_cmd(gint idx, const gchar *cmd, const gchar *dir); static void on_make_target_dialog_response(GtkDialog *dialog, gint response, gpointer user_data); static void on_make_target_entry_activate(GtkEntry *entry, gpointer user_data); @@ -197,7 +196,7 @@
// write a little shellscript to call the executable (similar to anjuta_launcher but "internal") // (RUN_SCRIPT_CMD should be ok in UTF8 without converting in locale because it contains no umlauts) - if (! build_create_shellscript(idx, RUN_SCRIPT_CMD, locale_cmd_string, TRUE)) + if (! build_create_shellscript(RUN_SCRIPT_CMD, locale_cmd_string, TRUE)) { gchar *utf8_check_executable = utils_remove_ext_from_filename(doc_list[idx].file_name); msgwin_status_add(_("Failed to execute %s (start-script could not be created)"), @@ -525,9 +524,11 @@ if (doc_list[idx].file_type->id == GEANY_FILETYPES_JAVA) { #ifdef G_OS_WIN32 + gchar *tmp; // there is already the extension .exe, so first remove it and then add .class - check_executable = utils_remove_ext_from_filename(long_executable); - check_executable = g_strconcat(check_executable, ".class", NULL); + tmp = utils_remove_ext_from_filename(long_executable); + check_executable = g_strconcat(tmp, ".class", NULL); + g_free(tmp); #else check_executable = g_strconcat(long_executable, ".class", NULL); #endif @@ -585,7 +586,7 @@
// write a little shellscript to call the executable (similar to anjuta_launcher but "internal") // (RUN_SCRIPT_CMD should be ok in UTF8 without converting in locale because it contains no umlauts) - if (! build_create_shellscript(idx, RUN_SCRIPT_CMD, cmd, autoclose)) + if (! build_create_shellscript(RUN_SCRIPT_CMD, cmd, autoclose)) { utf8_check_executable = utils_remove_ext_from_filename(doc_list[idx].file_name); msgwin_status_add(_("Failed to execute %s (start-script could not be created)"), @@ -876,8 +877,7 @@ }
-static gboolean build_create_shellscript(const gint idx, const gchar *fname, const gchar *cmd, - gboolean autoclose) +static gboolean build_create_shellscript(const gchar *fname, const gchar *cmd, gboolean autoclose) { FILE *fp; gchar *str;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.