From 84895a4f793f099a116ad5a5a2217c3e9c019ec1 Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 9 Sep 2014 01:11:21 +0200 Subject: [PATCH] Fix for 'Crash double-clicking any knob in debug build (git master) (#948)' Conflicts: src/gui/widgets/knob.cpp --- include/JournallingObject.h | 3 +++ src/gui/widgets/knob.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/JournallingObject.h b/include/JournallingObject.h index 3f6e47a82..b9ada746e 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -77,6 +77,9 @@ public: return oldJournalling; } + inline bool isEmpty() { + return m_journallingStateStack.isEmpty(); + } protected: void changeID( jo_id_t _id ); diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 7bb226795..dabd9cc49 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -592,7 +592,9 @@ void knob::mouseReleaseEvent( QMouseEvent* event ) AutomatableModel *thisModel = model(); if( thisModel ) { - thisModel->restoreJournallingState(); + if(!thisModel->isEmpty()) { + thisModel->restoreJournallingState(); + } } }