Skip to content

crash_when_open_score_fix_410 #18444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/engraving/rw/read400/readcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,15 @@ void ReadContext::clearOrphanedConnectors()
std::set<LinkedObjects*> deletedLinks;

auto deleteConnectors = [&deletedLinks](std::shared_ptr<ConnectorInfoReader> c) {
EngravingItem* conn = c->releaseConnector();
EngravingItem* conn = c ? c->releaseConnector() : nullptr;
if (!conn) {
return;
}

LinkedObjects* links = conn->links();
bool linksWillBeDeleted = links && links->size() == 1;

if (conn && !conn->isTuplet()) { // tuplets are added to score even when not finished
if (!conn->isTuplet()) { // tuplets are added to score even when not finished
if (linksWillBeDeleted) {
deletedLinks.insert(links);
}
Expand Down
7 changes: 5 additions & 2 deletions src/engraving/rw/read410/readcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,15 @@ void ReadContext::clearOrphanedConnectors()
std::set<LinkedObjects*> deletedLinks;

auto deleteConnectors = [&deletedLinks](std::shared_ptr<ConnectorInfoReader> c) {
EngravingItem* conn = c->releaseConnector();
EngravingItem* conn = c ? c->releaseConnector() : nullptr;
if (!conn) {
return;
}

LinkedObjects* links = conn->links();
bool linksWillBeDeleted = links && links->size() == 1;

if (conn && !conn->isTuplet()) { // tuplets are added to score even when not finished
if (!conn->isTuplet()) { // tuplets are added to score even when not finished
if (linksWillBeDeleted) {
deletedLinks.insert(links);
}
Expand Down