diff options
author | waker <wakeroid@gmail.com> | 2012-09-06 20:35:14 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-09-06 20:35:14 +0200 |
commit | a87d6d7c51eabda38b935bc8204a4a28ba1e74d8 (patch) | |
tree | e75228ff08411312762efe2daa69f61d93e73e3f | |
parent | 62155250836609cc7896953b25ac300c17fbd7de (diff) |
gtkui: fixed trkproperties memleak on shutdown and few compiler warnings
-rw-r--r-- | plugins/gtkui/gtkui.c | 4 | ||||
-rw-r--r-- | plugins/gtkui/search.c | 7 | ||||
-rw-r--r-- | plugins/gtkui/search.h | 3 | ||||
-rw-r--r-- | plugins/gtkui/trkproperties.c | 14 |
4 files changed, 24 insertions, 4 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 6f633d32..b5286536 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -1386,6 +1386,10 @@ gtkui_disconnect (void) { static gboolean quit_gtk_cb (gpointer nothing) { + extern int trkproperties_modified; + trkproperties_modified = 0; + trkproperties_destroy (); + search_destroy (); gtk_main_quit (); return FALSE; } diff --git a/plugins/gtkui/search.c b/plugins/gtkui/search.c index decd3fe4..432c7022 100644 --- a/plugins/gtkui/search.c +++ b/plugins/gtkui/search.c @@ -69,6 +69,12 @@ search_start (void) { } void +search_destroy (void) { + gtk_widget_destroy (searchwin); + searchwin = NULL; +} + +void search_process (const char *text) { ddb_playlist_t *plt = deadbeef->plt_get_curr (); deadbeef->plt_search_process (plt, text); @@ -417,4 +423,3 @@ search_playlist_init (GtkWidget *widget) { } lock_column_config = 0; } - diff --git a/plugins/gtkui/search.h b/plugins/gtkui/search.h index 7a2a3727..34931692 100644 --- a/plugins/gtkui/search.h +++ b/plugins/gtkui/search.h @@ -26,6 +26,9 @@ extern int search_count; void search_start (void); +void +search_destroy (void); + // should be called whenever playlist was changed void search_refresh (void); diff --git a/plugins/gtkui/trkproperties.c b/plugins/gtkui/trkproperties.c index 8fad64ad..74bd3a32 100644 --- a/plugins/gtkui/trkproperties.c +++ b/plugins/gtkui/trkproperties.c @@ -46,7 +46,7 @@ static GtkWidget *trackproperties; static GtkCellRenderer *rend_text2; static GtkListStore *store; static GtkListStore *propstore; -static int trkproperties_modified; +int trkproperties_modified; static DB_playItem_t **tracks; static int numtracks; static GtkWidget *progressdlg; @@ -183,6 +183,14 @@ on_trackproperties_delete_event (GtkWidget *widget, return TRUE; } +void +on_remove_field_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_add_field_activate (GtkMenuItem *menuitem, + gpointer user_data); + gboolean on_trackproperties_key_press_event (GtkWidget *widget, GdkEventKey *event, @@ -635,7 +643,7 @@ void on_add_field_activate (GtkMenuItem *menuitem, gpointer user_data) { GtkTreeView *treeview = GTK_TREE_VIEW (lookup_widget (trackproperties, "metalist")); - if (!gtk_widget_is_focus(treeview)) { + if (!gtk_widget_is_focus(GTK_WIDGET (treeview))) { return; // do not add field if Metadata tab is not focused } GtkWidget *dlg = create_entrydialog (); @@ -712,7 +720,7 @@ on_remove_field_activate (GtkMenuItem *menuitem, gpointer user_data) { GtkTreeView *treeview = GTK_TREE_VIEW (lookup_widget (trackproperties, "metalist")); - if (!gtk_widget_is_focus(treeview)) { + if (!gtk_widget_is_focus(GTK_WIDGET (treeview))) { return; // do not remove field if Metadata tab is not focused } GtkTreePath *path; |