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

Fix GH#145: Crash going from page to continuous view and then clicking on score element #146

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

Jojo-Schmitz
Copy link
Owner

Resolves: #145

@Jojo-Schmitz
Copy link
Owner Author

Darn, the linux build, esp. the mtests, run out of disk space

@worldwideweary
Copy link

worldwideweary commented Aug 6, 2023

Oh that's too bad about disk-space. Wonder what changed to have that happen?

Yes, that's right. To be a little "correct" also, you could change out since it's the same code from same situation

libmscore/page.cpp:

void Page::drawHeaderFooter(QPainter* p, int area, const QString& ss) const

has the line:

text->setParent(0);

and the 0 could become nullptr. But that's just "modern" correction

The crash is rare, but when it happens, it's weird to solve.
It happens when getting pagePos() from

      bool Element::contains(const QPointF& p) const
      {
      return shape().contains(p - pagePos());
      }

at the code that reads:

 else {
            if (parent()->parent())
                  p += parent()->pagePos();
            }

where parent() would end up being this text pointer (from the headerfooter code of the mentioned PR) that had a parent (page pointer) passing the nullptr check but then has no actual member functions set up properly or something like that and crashes on the pagePos() call. Difficult to find imo. I couldn't even call parent()->name() to find out what kind of element it was that was having a problem.... since parent was this "half-fake" text pointer creation thing.

@worldwideweary
Copy link

worldwideweary commented Aug 6, 2023

Oh, hey by the way for example:

https://musescore.com/user/2660886/scores/6026988 if you download that score and then load it up, select an element in page view, then switch to continuous view and click around the first systems' notes... it should be easier to reproduce the crash I'm getting as an example

Looks like the damned mtests of Linux build is still having a problem

@Jojo-Schmitz
Copy link
Owner Author

Jojo-Schmitz commented Aug 6, 2023

Doesn't reproduce with that score for me either. But I'm not on Windows (11), so stuff like a dangling pointer may not crash at all or at a different place.

@Jojo-Schmitz
Copy link
Owner Author

@worldwideweary please check #150, I guess this change here cause that.

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.

None yet

2 participants