Fixes memory leak of DolphinMainWindow
AbandonedPublic

Authored by hallas on Jul 29 2018, 10:09 AM.

Details

Reviewers
elvisangelaccio
Summary

Fixes memory leak of DolphinMainWindow
In the main function the DolphinMainWindow was stored in a plain old
pointer causing it to be leaked, instead keep it in a QPointer so
we are sure it is correctly freed when the application exists.

Test Plan

This leak was found using Address Sanitizer

Diff Detail

Repository
R318 Dolphin
Branch
fixes_leak_of_main_window (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1322
Build 1340: arc lint + arc unit
hallas created this revision.Jul 29 2018, 10:09 AM
Restricted Application added a project: Dolphin. · View Herald TranscriptJul 29 2018, 10:09 AM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
hallas requested review of this revision.Jul 29 2018, 10:09 AM
elvisangelaccio requested changes to this revision.Jul 29 2018, 6:31 PM
elvisangelaccio added a subscriber: elvisangelaccio.

QPointer is not a smart pointer and doesn't handle memory. But we don't need it anyway, because we have the Qt::WA_DeleteOnClose attribute set which does the cleanup.

I think this is just a false positive from ASAN, since Qt::WA_DeleteOnClose is a Qt-specific thing that ASAN probably doesn't know.

This revision now requires changes to proceed.Jul 29 2018, 6:31 PM
hallas abandoned this revision.Jul 29 2018, 6:55 PM

QPointer is not a smart pointer and doesn't handle memory. But we don't need it anyway, because we have the Qt::WA_DeleteOnClose attribute set which does the cleanup.

I think this is just a false positive from ASAN, since Qt::WA_DeleteOnClose is a Qt-specific thing that ASAN probably doesn't know.

Yes, you are right. I can see from testing that I have mixed up my changes a little bit :)

Closing this one...