From 54d2ad371118eeeffd836d92385c8059df02d1c0 Mon Sep 17 00:00:00 2001 From: "D. Fober" Date: Wed, 2 Aug 2023 09:53:39 +0200 Subject: [PATCH] skip associations for GRGrace --- src/engine/graphic/GRGrace.h | 4 +++- src/engine/graphic/GRNotationElement.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/engine/graphic/GRGrace.h b/src/engine/graphic/GRGrace.h index 883c258a9..58be74a6b 100644 --- a/src/engine/graphic/GRGrace.h +++ b/src/engine/graphic/GRGrace.h @@ -31,7 +31,9 @@ class GRGrace : public GRARCompositeNotationElement, virtual ~GRGrace() {} virtual void tellPosition( GObject * caller,const NVPoint & inPos ); -// virtual void addAssociation( GRNotationElement * p ); + // DF-02-08-2023 don't add associations to grace (useless) + // solves the crash bug in issue #173 + virtual void addAssociation( GRNotationElement * p ) {} virtual GuidoPos AddTail( GRNotationElement * el ); }; diff --git a/src/engine/graphic/GRNotationElement.cpp b/src/engine/graphic/GRNotationElement.cpp index e63d3d832..30cf55567 100644 --- a/src/engine/graphic/GRNotationElement.cpp +++ b/src/engine/graphic/GRNotationElement.cpp @@ -29,6 +29,7 @@ #include "GRClef.h" #include "GRKey.h" #include "GRMeter.h" +#include "GRGrace.h" // - Guido AR #include "ARMusicalObject.h" @@ -372,6 +373,11 @@ NVRect GRNotationElement::getAssociatedBoundingBox() const // ------------------------------------------------------------------------- void GRNotationElement::addAssociation( GRNotationElement * p ) { + // DF 02-08-2023 don't associate a GRGrace to any element + // it's useless since notes are already notified of their 'grace' status + // solves the crash of issue #173 + if (dynamic_cast(p)) return; + if (mAssociated == 0) mAssociated = new NEPointerList; // these elements don't belong to the list