summaryrefslogtreecommitdiff
path: root/print-notifications-clear-in-stop.patch
blob: 649defdfb87918980516a30b476b22b95ce0e561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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);
 }