From 175ac385109dd47522e69830a9dfc0b2d22ffcb7 Mon Sep 17 00:00:00 2001 From: "Joey L." Date: Wed, 29 Jul 2026 08:59:34 -0600 Subject: [PATCH] Fix crash when opening Automation Editor after setting ghost notes (#8488) Fixes a crash when opening the Automation Editor with invalid ghost notes (or more specifically, when the editor draws the ghost notes). Setting ghost notes in the Automation Editor with a MIDI clip (but not a sample clip) sets a pointer to it, but deleting the clip or loading a new project makes the pointer invalid without setting to a null pointer. --- include/AutomationEditor.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 0fc5057276..c83d8c671b 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -33,6 +33,7 @@ #include "ComboBoxModel.h" #include "Editor.h" #include "JournallingObject.h" +#include "MidiClip.h" #include "SampleClip.h" #include "TimePos.h" #include "LmmsTypes.h" @@ -43,9 +44,6 @@ class QScrollBar; namespace lmms { - -class MidiClip; - namespace gui { @@ -232,8 +230,9 @@ private: float m_bottomLevel; float m_topLevel; - MidiClip* m_ghostNotes = nullptr; - QPointer m_ghostSample = nullptr; // QPointer to set to nullptr on deletion + // QPointers to set to nullptr on deletion + QPointer m_ghostNotes = nullptr; + QPointer m_ghostSample = nullptr; bool m_renderSample = false; void centerTopBottomScroll();