mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-10-26 17:42:12 +03:00
Fix trying to disconnect null PulseContext when reloading config. Fixes #231
This commit is contained in:
parent
024b370a21
commit
74d6353e97
@ -8,7 +8,7 @@ namespace SwayNotificationCenter.Widgets {
|
||||
* https://github.com/elementary/switchboard-plug-sound
|
||||
*/
|
||||
public class PulseDaemon : Object {
|
||||
private Context context;
|
||||
private Context? context;
|
||||
private GLibMainLoop mainloop;
|
||||
private bool quitting = false;
|
||||
|
||||
@ -33,8 +33,14 @@ namespace SwayNotificationCenter.Widgets {
|
||||
|
||||
public void close () {
|
||||
quitting = true;
|
||||
context.disconnect ();
|
||||
context = null;
|
||||
if (this.context != null) {
|
||||
context.disconnect ();
|
||||
context = null;
|
||||
}
|
||||
}
|
||||
|
||||
~PulseDaemon() {
|
||||
this.close ();
|
||||
}
|
||||
|
||||
public signal void change_default_device (PulseDevice device);
|
||||
|
@ -25,7 +25,6 @@ namespace SwayNotificationCenter.Widgets {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public Volume (string suffix, SwayncDaemon swaync_daemon, NotiDaemon noti_daemon) {
|
||||
base (suffix, swaync_daemon, noti_daemon);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user