Commit 10be0645 authored by Ian Main's avatar Ian Main
Browse files

Forgot to free GList on destroy, and to destroy fileop dialog boxes.


	Ian
parent b533c32d
......@@ -50,6 +50,16 @@
#define FILE_LIST_WIDTH 180
#define FILE_LIST_HEIGHT 180
/* I've put this here so it doesn't get confused with the
* file completion interface */
typedef struct _HistoryCallbackArg HistoryCallbackArg;
struct _HistoryCallbackArg
{
gchar *directory;
GtkWidget *menu_item;
};
typedef struct _CompletionState CompletionState;
typedef struct _CompletionDir CompletionDir;
......@@ -561,12 +571,27 @@ static void
gtk_file_selection_destroy (GtkObject *object)
{
GtkFileSelection *filesel;
GList *list;
HistoryCallbackArg *callback_arg;
g_return_if_fail (object != NULL);
g_return_if_fail (GTK_IS_FILE_SELECTION (object));
filesel = GTK_FILE_SELECTION (object);
if (filesel->fileop_dialog)
gtk_widget_destroy (filesel->fileop_dialog);
if (filesel->history_list) {
list = filesel->history_list;
while (list) {
callback_arg = list->data;
g_free (callback_arg->directory);
list = list->next;
}
g_list_free (filesel->history_list);
}
cmpl_free_state (filesel->cmpl_state);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
......@@ -957,13 +982,6 @@ gtk_file_selection_key_press (GtkWidget *widget,
return FALSE;
}
typedef struct _HistoryCallbackArg HistoryCallbackArg;
struct _HistoryCallbackArg
{
gchar *directory;
GtkWidget *menu_item;
};
static void
gtk_file_selection_history_callback (GtkWidget *widget, gpointer data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment