D26764: Another revert to unbreak crash fix
Konstantin Kharlamov
noreply at phabricator.kde.org
Sat Jan 25 00:35:39 GMT 2020
kkharlamov added a comment.
Okay, so, this seems not to be so simple as it appears to be. While making the variable `static` does help with destructing it on `exit()` call, however it causes some other crash when konsole exits. I can only guess.
Since fixing a crash is an urgent thing, and I don't have time right now to delve into why declaring QApplication as `static` causes another crash, I'm okay with reverting the commit as temporary workaround. @sandsmark I think though, to make sure nobody gonna commit such code again, it would help to add a comment just above `auto app = new QApplication(argc, argv);`, explaining why it's there. E.g. `// allocate it on the heap so we can destroy it on exit() for the KDBus workaround`.
And then, the following comment is confusing, it was the sole reason nobody noticed anyting wrong when RAII refactor happened. All it actually says is simply "we've used `new` to allocate the variable, so let's not forget to call `delete`". It's better to get rid of it entirely:
// Since we've allocated the QApplication on the heap for the KDBusService workaround,
// we need to delete it manually before returning from main().
REPOSITORY
R319 Konsole
REVISION DETAIL
https://phabricator.kde.org/D26764
To: sandsmark, #konsole, hindenburg, kkharlamov
Cc: anthonyfieroni, konsole-devel, hindenburg, #konsole, hiangel, cent, EspadaV8, fbampaloukas, thsurrel, ngraham, maximilianocuria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20200125/3c745084/attachment-0001.html>
More information about the konsole-devel
mailing list