Skip to content
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

Fixed trigger assert on remove acc from ambitus #9831

Conversation

igorkorsukov
Copy link
Contributor

No description provided.

void Ambitus::remove(EngravingItem* e)
{
if (e->type() == ElementType::ACCIDENTAL) {
//! NOTE Do nothing (removing _topAccid or _bottomAccid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doing nothing? Via Inspector the Ambitus can get changed to a non-accidental note, why not via deleting the accidental here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because they are deleted in

Ambitus::~Ambitus()
{
    delete _topAccid;
    delete _bottomAccid;
}

They hide somehow differently (I did not investigate in detail)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, using you patch, they don't disapear, so don't delete at all, unless you delete the entire Ambitus (only that would call the destructor)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no plans to change the implementation and logic of Ambitus.
I just avoided triggering the assertion, that is, I didn’t make worse than it was, I did it a little better.
Do you think it is necessary to reconsider the implementation of Ambitus?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, doing nothing here is certainly better than a crash

@DmitryArefiev
Copy link
Contributor

DmitryArefiev commented Nov 25, 2021

Tested #9447 on Win10, Mac12, LinuxMint 20.2 - FIXED

Please merge into master

@igorkorsukov Found another crash when using ambitus #9866 (not caused by the current PR)

@igorkorsukov igorkorsukov merged commit e0430f8 into musescore:master Nov 25, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 25, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 26, 2021
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 28, 2021
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 28, 2021
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 28, 2021
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 30, 2021
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 7, 2021
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
Fixed by just ignoring the operation, i.e. not removing the accidental.
Instead do this via the Inspector.

Backport of musescore#9831
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Crash] Removing an accidental from an Ambitus causes MS4 to crash.
4 participants