core: Properly parent QObject-derived attributes
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 30 May 2018 20:20:17 +0000 (22:20 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 6 Jun 2018 19:12:17 +0000 (21:12 +0200)
In order to be able to move the Core instance to another thread,
all QObject-derived attributes must be properly parented, so they
move with their parent object.

src/core/core.cpp

index 48e4f0f..b103b42 100644 (file)
@@ -81,6 +81,12 @@ Core::Core()
         delete _instance;
     }
     _instance = this;
+
+    // Parent all QObject-derived attributes, so when the Core instance gets moved into another
+    // thread, they get moved with it
+    _server.setParent(this);
+    _v6server.setParent(this);
+    _storageSyncTimer.setParent(this);
 }