From a67c563d6f479277fa670d19aae72c80eab79a80 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 27 Jul 2009 03:15:31 +0000 Subject: [PATCH] Fixed some memory leaks. --- src/commands/cmd_configure_screen.cpp | 1 + src/console/console.cpp | 2 ++ src/core/drop_files.cpp | 4 +++- src/jinete/jcombobox.cpp | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/cmd_configure_screen.cpp b/src/commands/cmd_configure_screen.cpp index b2401503a..26f916728 100644 --- a/src/commands/cmd_configure_screen.cpp +++ b/src/commands/cmd_configure_screen.cpp @@ -237,6 +237,7 @@ static bool alert_msg_proc(JWidget widget, JMessage msg) usprintf(buf, "In %d seconds the screen will be restored.", seconds_to_accept); jwidget_set_text((JWidget)labels->end->next->next->data, buf); + jlist_free(labels); if (seconds_to_accept == 0) { jmanager_stop_timer(timer_to_accept); diff --git a/src/console/console.cpp b/src/console/console.cpp index 9d6fd7549..682a08d3f 100644 --- a/src/console/console.cpp +++ b/src/console/console.cpp @@ -133,6 +133,8 @@ void Console::printf(const char *format, ...) jwidget_set_rect(wid_console, rect); jwindow_center(wid_console); jwidget_dirty(wid_console); + + jrect_free(rect); } text = jwidget_get_text(wid_textbox); diff --git a/src/core/drop_files.cpp b/src/core/drop_files.cpp index 5d0036e15..317e8180a 100644 --- a/src/core/drop_files.cpp +++ b/src/core/drop_files.cpp @@ -52,9 +52,11 @@ void install_drop_files() void uninstall_drop_files() { unsubclass_hwnd(); - + jmutex_free(dropped_files_mutex); dropped_files_mutex = NULL; + + dropped_files.clear(); } void check_for_dropped_files() diff --git a/src/jinete/jcombobox.cpp b/src/jinete/jcombobox.cpp index a4b28788e..0c2cbdf33 100644 --- a/src/jinete/jcombobox.cpp +++ b/src/jinete/jcombobox.cpp @@ -541,6 +541,7 @@ static void combobox_close_window(JWidget widget) ComboBox* combobox = reinterpret_cast(jwidget_get_data(widget, JI_COMBOBOX)); if (combobox->window) { jwindow_close(combobox->window, widget); + jwidget_free(combobox->window); combobox->window = NULL; jmanager_remove_msg_filter(JM_BUTTONPRESSED, widget);