Commit 8b6af614 authored by Erik Reider's avatar Erik Reider

Fixed reloading the config sometimes segfauling

Caused by "app.config_reload" in the control center. Changing a value, reloading, and then chaning it again and reloading -> segfault
parent fd7896e5
...@@ -300,8 +300,6 @@ namespace SwayNotificationCenter { ...@@ -300,8 +300,6 @@ namespace SwayNotificationCenter {
#endif #endif
public class ConfigModel : Object, Json.Serializable { public class ConfigModel : Object, Json.Serializable {
private static ConfigModel ? previous_config = null;
private static ConfigModel ? _instance = null; private static ConfigModel ? _instance = null;
private static string _path = ""; private static string _path = "";
...@@ -352,7 +350,8 @@ namespace SwayNotificationCenter { ...@@ -352,7 +350,8 @@ namespace SwayNotificationCenter {
critical (e.message); critical (e.message);
m = new ConfigModel (); m = new ConfigModel ();
} }
previous_config = _instance;
ConfigModel ? previous_config = _instance;
_instance = m; _instance = m;
_path = path; _path = path;
......
...@@ -15,8 +15,7 @@ namespace SwayNotificationCenter { ...@@ -15,8 +15,7 @@ namespace SwayNotificationCenter {
static bool activated = false; static bool activated = false;
public signal void config_reload ( public signal void config_reload (ConfigModel ? old_config, ConfigModel new_config);
owned ConfigModel ? old_config, ConfigModel new_config);
public Swaync () { public Swaync () {
Object ( Object (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment