Skip to content

Commit

Permalink
Fix GH#9447: Crash on removing accidental from ambitus
Browse files Browse the repository at this point in the history
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
  • Loading branch information
igorkorsukov authored and Jojo-Schmitz committed Nov 28, 2021
1 parent bf04337 commit 484c3c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libmscore/ambitus.cpp
Expand Up @@ -629,6 +629,16 @@ void Ambitus::updateRange()
}
}

void Ambitus::remove(Element* e)
{
if (e->type() == ElementType::ACCIDENTAL) {
//! NOTE Do nothing (removing _topAccid or _bottomAccid)
return;
}

Element::remove(e);
}

//---------------------------------------------------------
// getProperty
//---------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions libmscore/ambitus.h
Expand Up @@ -90,6 +90,8 @@ class Ambitus final : public Element {
bool readProperties(XmlReader&) override;
QString accessibleInfo() const override;

void remove(Element*) override;

// properties
QVariant getProperty(Pid ) const;
bool setProperty(Pid propertyId, const QVariant&);
Expand Down

0 comments on commit 484c3c9

Please sign in to comment.