summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-07-26 01:56:46 -0400
committermonsta <[email protected]>2017-11-16 00:43:50 +0300
commit86c64efc423448dfb3d069ba3b701bdae6c7db10 (patch)
tree00e80f6edf56ba3a2747df1a5c24516d76abeea2 /applets
parenteb94be26360b597c157b52a25a42e834655a8dc2 (diff)
downloadmate-panel-86c64efc423448dfb3d069ba3b701bdae6c7db10.tar.bz2
mate-panel-86c64efc423448dfb3d069ba3b701bdae6c7db10.tar.xz
wncklet: disconnect signal handlers on destroy
Stop segfaults, warnings on removing in-process switcher, window-list Fixes window list, workspace switcher. Window menu and show desktop no warnings or segfaults on removal when built in process (squashed 9f43dd5c7c37b84960d06a98a4738ee40d8bfd50 + 2b17f4f461cff056ab0f4687a9ac673a16933f7c for 1.18 branch)
Diffstat (limited to 'applets')
-rw-r--r--applets/wncklet/window-list.c26
-rw-r--r--applets/wncklet/workspace-switcher.c22
2 files changed, 28 insertions, 20 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index 35bdbd45..da232447 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -63,6 +63,7 @@ static void call_system_monitor(GtkAction* action, TasklistData* tasklist);
static void display_properties_dialog(GtkAction* action, TasklistData* tasklist);
static void display_help_dialog(GtkAction* action, TasklistData* tasklist);
static void display_about_dialog(GtkAction* action, TasklistData* tasklist);
+static void destroy_tasklist(GtkWidget* widget, TasklistData* tasklist);
static void tasklist_update(TasklistData* tasklist)
{
@@ -147,16 +148,6 @@ static void applet_change_pixel_size(MatePanelApplet* applet, gint size, Tasklis
tasklist_update(tasklist);
}
-static void destroy_tasklist(GtkWidget* widget, TasklistData* tasklist)
-{
- g_object_unref(tasklist->settings);
-
- if (tasklist->properties_dialog)
- gtk_widget_destroy(tasklist->properties_dialog);
-
- g_free(tasklist);
-}
-
/* TODO: this is sad, should be used a function to retrieve applications from
* .desktop or some like that. */
static const char* system_monitors[] = {
@@ -694,3 +685,18 @@ static void display_properties_dialog(GtkAction* action, TasklistData* tasklist)
gtk_window_set_screen(GTK_WINDOW(tasklist->properties_dialog), gtk_widget_get_screen(tasklist->applet));
gtk_window_present(GTK_WINDOW(tasklist->properties_dialog));
}
+
+static void destroy_tasklist(GtkWidget* widget, TasklistData* tasklist)
+{
+ g_signal_handlers_disconnect_by_data (G_OBJECT (tasklist->applet), tasklist);
+
+ g_signal_handlers_disconnect_by_data (tasklist->settings, tasklist);
+
+ g_object_unref(tasklist->settings);
+
+ if (tasklist->properties_dialog)
+ gtk_widget_destroy(tasklist->properties_dialog);
+
+ g_free(tasklist);
+
+}
diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c
index f9d422ab..cdeca09c 100644
--- a/applets/wncklet/workspace-switcher.c
+++ b/applets/wncklet/workspace-switcher.c
@@ -86,6 +86,7 @@ typedef struct {
static void display_properties_dialog(GtkAction* action, PagerData* pager);
static void display_help_dialog(GtkAction* action, PagerData* pager);
static void display_about_dialog(GtkAction* action, PagerData* pager);
+static void destroy_pager(GtkWidget* widget, PagerData* pager);
static void pager_update(PagerData* pager)
{
@@ -319,16 +320,6 @@ static gboolean applet_scroll(MatePanelApplet* applet, GdkEventScroll* event, Pa
return TRUE;
}
-static void destroy_pager(GtkWidget* widget, PagerData* pager)
-{
- g_object_unref (pager->settings);
-
- if (pager->properties_dialog)
- gtk_widget_destroy(pager->properties_dialog);
-
- g_free(pager);
-}
-
static const GtkActionEntry pager_menu_actions[] = {
{
"PagerPreferences",
@@ -967,3 +958,14 @@ static void display_properties_dialog(GtkAction* action, PagerData* pager)
gtk_window_set_screen(GTK_WINDOW(pager->properties_dialog), gtk_widget_get_screen(pager->applet));
gtk_window_present(GTK_WINDOW(pager->properties_dialog));
}
+
+static void destroy_pager(GtkWidget* widget, PagerData* pager)
+{
+ g_signal_handlers_disconnect_by_data (pager->settings, pager);
+
+ g_object_unref (pager->settings);
+
+ if (pager->properties_dialog)
+ gtk_widget_destroy(pager->properties_dialog);
+ g_free(pager);
+}