diff options
author | Marek Kasik <mkasik@redhat.com> | 2020-06-03 17:59:01 +0200 |
---|---|---|
committer | Marek Kasik <mkasik@redhat.com> | 2020-06-03 18:02:50 +0200 |
commit | cdb4727690525c736096625683fdff8b951f0127 (patch) | |
tree | 5a85ffbe9a345270e9e7dc6872e16c70bec5a872 | |
parent | c6cc59b9736cf725825641744ce211a83bfe9918 (diff) | |
download | gnome-control-center-cdb4727690525c736096625683fdff8b951f0127.tar.gz |
printers: Do not crash due to wrong argument
Callback for handling of "notification-dismiss-button" got its
parameters swapped. This resulted in crash when user closed
notification about deleted printer.
This commit converts the on_notification_dismissed() function
to accept swapped arguments as was probably intended.
-rw-r--r-- | panels/printers/cc-printers-panel.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c index db5bc9bc8..68c5b194d 100644 --- a/panels/printers/cc-printers-panel.c +++ b/panels/printers/cc-printers-panel.c @@ -636,11 +636,8 @@ on_printer_deletion_undone (CcPrintersPanel *self) } static void -on_notification_dismissed (GtkButton *button, - gpointer user_data) +on_notification_dismissed (CcPrintersPanel *self) { - CcPrintersPanel *self = (CcPrintersPanel*) user_data; - if (self->deleted_printer_name != NULL) { PpPrinter *printer; @@ -660,7 +657,7 @@ on_notification_dismissed (GtkButton *button, static gboolean on_remove_printer_timeout (gpointer user_data) { - on_notification_dismissed (NULL, user_data); + on_notification_dismissed (user_data); return G_SOURCE_REMOVE; } @@ -675,7 +672,7 @@ on_printer_deleted (CcPrintersPanel *self, gtk_widget_hide (GTK_WIDGET (printer_entry)); - on_notification_dismissed (NULL, self); + on_notification_dismissed (self); g_object_get (printer_entry, "printer-name", &printer_name, |