summaryrefslogtreecommitdiffstats
path: root/src/mixxx.h
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-07-19 14:33:37 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-07-20 01:12:55 +0200
commitdd48f6ad7665469affa3b7c6b3d8d319d031c6b7 (patch)
treef4714a55e09c8a8ff654d7832d19b156ccda26a9 /src/mixxx.h
parent4a3d006f56cd7c967c68f9f70c0501427381ed0a (diff)
LegacySkinParser: Persist skin-created COs even on skin changes
Up until now, Skin-created COs were parented to a skin widget, which means that they will be deleted when the skin is unloaded and the skin widget is destroyed. This sounds like a good idea, but it's actually quite problematic. Controller mappings may connect to these COs, and as they are not reloaded when the skin is changed these ControlProxy objects will still hold a reference to the internal ControlDoublePrivate, even though the actual ControlObject has been deleted. When switching to a skin that attempts to create a CO that has been destroyed earlier, this causes a DEBUG_ASSERT. This commit removes the parenting of skin-created control objects. Instead, all skin-created COs are put into a global set of skin COs, and its contents will only be destroyed in MixxxMainWindow::finalize(), i.e. when Mixxx is exited. That way, all skin-created COs persist accross skin changes and skins can reuse COs created by other skins. This is definitely not a pretty "solution", but it does the job: It fixes the DEBUG_ASSERT that was thrown on skin change when a controller mapping was connected a CO that was destroyed and the new skin tries to create a new CO under the same key. The controller mapping keeps working even after the skin change. Related Zulip discussion: https://mixxx.zulipchat.com/#narrow/stream/109171-development/topic/DEBUG_ASSERT.20on.20skin.20change
Diffstat (limited to 'src/mixxx.h')
-rw-r--r--src/mixxx.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mixxx.h b/src/mixxx.h
index f34157f888..7fb3c2a683 100644
--- a/src/mixxx.h
+++ b/src/mixxx.h
@@ -184,6 +184,8 @@ class MixxxMainWindow : public QMainWindow {
ControlPushButton* m_pTouchShift;
mixxx::ScreenSaverPreference m_inhibitScreensaver;
+ QSet<ControlObject*> m_skinCreatedControls;
+
static const int kMicrophoneCount;
static const int kAuxiliaryCount;
};