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 quit crash #47

Closed
wants to merge 1 commit into from
Closed

Fixed quit crash #47

wants to merge 1 commit into from

Conversation

R4H33M
Copy link
Contributor

@R4H33M R4H33M commented Jan 8, 2020

Fixes #36

Took quite a lot of detective work to get this one down. I was able to trace the issue to BWindow::Quit();.
The issue stems from BScrollView's BScrollBars, which is improperly deallocated due to the TakeNote's special usage of NoteView, indeed, the problematic object is a child of BNoteView.

By calling a RemoveSelf on the NoteView, as advised on this page of the legacy docs: https://www.haiku-os.org/legacy-docs/bebook/BView.html, we prevent the crash and let's the program quit cleanly.

Edit: tested on both x86_64 and x86 (gcc2)

@pulkomandy
Copy link
Member

The fix does not look right to me. It is expected that a window owns all its views and will automatically delete them. If that does not work, the solution is not to remove the view from the window so that it is never deleted, the solution is to fix the view so that deleting it will work.

@R4H33M
Copy link
Contributor Author

R4H33M commented Jan 12, 2020

To keep things clean, I have made a separate PR for my latest potential fix to issue #36
It is here #49
Thank you for your advice @pulkomandy. When fixing bugs/crashes, it is important to really fix it from the real root of the issue.

@R4H33M R4H33M closed this Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Crash on quit after opening a saved note
2 participants