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 fullscreen editor's myScrollBar delayed destruction causing a crash #503
Conversation
I just had the crash again with this fix, as well as with a |
…mer signal The lambda function will keep a reference to the scrollbar python object preventing it from getting destroyed when the QScrollbar is destroyed. This causes the underlying QT widget to be freed while the python object still exists, therefore the timer itself doesn't get stopped/cleaned, so the timer will get called and cause a crash with : "RuntimeError: Wrapped C/C++ object of type myScrollbar has been deleted" To reproduce, press F11 repeatedly while scrolling.
bb37207
to
29a795a
Compare
I figured it out. Sorry for the first patch. You can reproduce by pressing F11 repeatedly fast enough, no need to scroll or anything. The issue was in using a lambda function for the timer. If you add prints in the Edit: I think the issue is that with the lambda, the timer itself keeps a reference on the python object, preventing it from getting deleted. When I was testing before, I had changed the code to use a function instead of lambda in order to add my print, which is why it became impossible to reproduce. |
Thank you @kakaroto for explaining how to reproduce the crash, and also providing a patch to fix the issue. On Kubuntu 16.04 I was able to reproduce the crash by loading a project into manuskript and then pressing F11 in rapid succession. I plan to review the Pull Requests in order of creation. If you would prefer a different order of review then let me know. I will merge this PR. Curtis |
Hey @gedakc, I hope you enjoyed your long weekend! |
Good suggestion. I will review the bug fixes first before moving on to the new features, such as alternate spell checkers. It may take me a few days as I have other project work too. Ideally I would like to get your patches reviewed and merged with an eye towards creating a new Manuskript release in early March. |
This can lead to a crash if a timer was started right before deletion, so that when
the timer is launched, the self.parent() crashes.
I've had this error happen to me multiple times after pressing F11 once as soon as I start the app, but I've been unable to reproduce it after adding debug messages (and also after removing them), so it looks like a heisenbug, but this should fix the problem, even though I can't test that it works, it seems logical. I'm also unsure on why a scrollbar would get destroyed after I enter fullscreen mode once without exiting it.