Clear members of GsdPrintNotificationsManager in stop()

Resolves: #2166842
This commit is contained in:
Marek Kasik 2023-02-20 17:01:31 +01:00
parent 1046d62fd3
commit e9714eccc1
2 changed files with 51 additions and 1 deletions

View File

@ -11,7 +11,7 @@
Name: gnome-settings-daemon
Version: 40.0.1
Release: 8%{?dist}
Release: 9%{?dist}
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
License: GPLv2+
@ -70,6 +70,7 @@ Requires: libgweather%{?_isa} >= %{libgweather_version}
Patch00001: 0001-power-Enable-power-saver-profile-when-low-on-battery.patch
Patch00002: subscription-manager-support.patch
Patch00003: im-module-setting-fix.patch
Patch00004: print-notifications-clear-in-stop.patch
%description
A daemon to share settings from GNOME to other applications. It also
@ -195,6 +196,10 @@ cp %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/glib-2.0/schemas
%{_libdir}/pkgconfig/gnome-settings-daemon.pc
%changelog
* Mon Feb 20 2023 Marek Kasik <mkasik@redhat.com> - 40.0.1-9
- Clear members of GsdPrintNotificationsManager in stop()
Resolves: #2166842
* Mon Aug 01 2022 Felipe Borges <feborges@redhat.com> - 40.0.1-8
- Fix registration with activation key
Resolves: #2100467

View File

@ -0,0 +1,45 @@
--- gnome-settings-daemon-40.0.1/plugins/print-notifications/gsd-print-notifications-manager.c
+++ gnome-settings-daemon-40.0.1/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -1268,6 +1268,7 @@ scp_handler (GsdPrintNotificationsManage
kill (manager->scp_handler_pid, SIGHUP);
g_spawn_close_pid (manager->scp_handler_pid);
manager->scp_handler_spawned = FALSE;
+ manager->scp_handler_pid = -1;
}
}
@@ -1636,8 +1636,10 @@ gsd_print_notifications_manager_stop (Gs
manager->check_source_id = 0;
}
- if (manager->subscription_id >= 0)
+ if (manager->subscription_id >= 0) {
cancel_subscription (manager->subscription_id);
+ manager->subscription_id = -1;
+ }
g_clear_pointer (&manager->printing_printers, g_hash_table_destroy);
@@ -1649,6 +1651,7 @@ gsd_print_notifications_manager_stop (Gs
g_source_remove (data->timeout_id);
}
g_list_free_full (manager->timeouts, free_timeout_data);
+ manager->timeouts = NULL;
for (tmp = manager->active_notifications; tmp; tmp = g_list_next (tmp)) {
reason_data = (ReasonData *) tmp->data;
@@ -1665,12 +1668,14 @@ gsd_print_notifications_manager_stop (Gs
}
}
g_list_free_full (manager->active_notifications, free_reason_data);
+ manager->active_notifications = NULL;
for (tmp = manager->held_jobs; tmp; tmp = g_list_next (tmp)) {
job = (HeldJob *) tmp->data;
g_source_remove (job->timeout_id);
}
g_list_free_full (manager->held_jobs, free_held_job);
+ manager->held_jobs = NULL;
scp_handler (manager, FALSE);
}