Bugfix: KMail: Detach from message observation when destructing KMReaderWin #23
Merged
MicheleC
merged 1 commits from kmail_newwin_crash
into master
5 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'kmail_newwin_crash'
Deleting a branch is permanent. It CANNOT be undone. Continue?
When opening and closing new main-windows, failure to detach from ISubjects at KMReaderWin destruction can result in a heap-use-after-free segfault when the ISubject tries to notify the (now non-existent) KMReaderWin of an event.
It looks good. I just ask for a small formatting style adjustment.
{
if (message())
message()->detach( this );
Please, can I request the addition of a brackets for a condition block? I know they are not necessary in this case, but we prefer to use brackets even for these cases. See article Code formatting style.
Hi Luke, the fix looks neat and simple, thanks! Is there a way to reproduce the original problem systematically? I would like to test here too, but I have not been able to crash Kmail so far 😞
I have added the parenthesis to Luke's code and credited Luke's for the commit anyway.
PR merged to main code and cherry-picked into R14.0.x branch as well.
Thanks for the good work Luke!
It typically happened when I made a new main window and then immediately closed the old main window.
(I did this because Xpra likes to "freeze" the window contents, and making a new window works around that.)
ok, thanks for the info Luke. Keep up the good work, we are glad to see new contributors 👍
e53303b929
.