Skip to content

Commit

Permalink
fix #15513: This crash is a consequence of the changes introduced in PR
Browse files Browse the repository at this point in the history
#13724: we don't layout closed parts anymore, so some elements (like H/Vbox) do not have a parent. Their parent (system) is dynamically created when doLayout() is executed
  • Loading branch information
RomanPudashkin committed Feb 1, 2023
1 parent b5adcca commit eae6e35
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/engraving/libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1681,16 +1681,14 @@ void Score::removeElement(EngravingItem* element)
EngravingItem* parent = element->parentItem();
element->triggerLayout();

// LOGD("Score(%p) EngravingItem(%p)(%s) parent %p(%s)",
// this, element, element->typeName(), parent, parent ? parent->typeName() : "");

// special for MEASURE, HBOX, VBOX
// their parent is not static

ElementType et = element->type();
bool parentIsVBox = parent && parent->isVBox();

if (et == ElementType::MEASURE
|| (et == ElementType::HBOX && !parent->isVBox())
|| (et == ElementType::HBOX && !parentIsVBox)
|| et == ElementType::VBOX
|| et == ElementType::TBOX
|| et == ElementType::FBOX
Expand All @@ -1699,8 +1697,10 @@ void Score::removeElement(EngravingItem* element)
measures()->remove(mb);
System* system = mb->system();

if (!system) { // vertical boxes are not shown in continuous view so no system
assert(lineMode() && (element->isVBox() || element->isTBox()));
if (!system) {
// vertical boxes are not shown in continuous view so no system
bool noSystemMode = lineMode() && (element->isVBox() || element->isTBox());
assert(noSystemMode || !isOpen());
return;
}

Expand Down

0 comments on commit eae6e35

Please sign in to comment.