Solve a memory leak in the Locate dialog, achieve that its destructor is able to work, and so on
ClosedPublic

Authored by asensi on Sep 21 2018, 1:28 PM.

Details

Summary

The Locate dialog is never destroyed (therefore its destructor (~LocateDlg) can't be used because it's never called , etc.), the present change can solve that.

This is a screenshot of a Valgrind report inside Qt Creator:


Additionally, if someone tries to use its destructor nowadays, e.g.:

~LocateDlg()
{
    QTextStream(stdout) << "DESTRUCTING" << endl;
}

he sees that that code is never executed.

Test Plan

Execute Krusader, launch the Locate dialog, sometimes close the Locate dialog, close Krusader.

Valgrind may be used, and a destructor like

~LocateDlg()
{
    QTextStream(stdout) << "DESTRUCTING" << endl;
}

can be added in order to know when the Locate dialog is really destroyed.

Diff Detail

Repository
R167 Krusader
Lint
Lint Skipped
Unit
Unit Tests Skipped
asensi requested review of this revision.Sep 21 2018, 1:28 PM
asensi created this revision.
asensi retitled this revision from Solve a memory leak in the Locate dialog (and now that it gets destroyed, its destructor is able to work, etc.) to Solve a memory leak in the Locate dialog, achieve that its destructor is able to work, and so on.Sep 21 2018, 1:34 PM
asensi edited the summary of this revision. (Show Details)
asensi edited the test plan for this revision. (Show Details)
nmel accepted this revision.Sep 22 2018, 5:18 AM
nmel added a subscriber: nmel.

Thanks Toni!

Please add to the commit message:
FIXED: memory leak in the Locate dialog

This revision is now accepted and ready to land.Sep 22 2018, 5:18 AM
asensi updated this revision to Diff 42132.EditedSep 22 2018, 3:57 PM

Thanks, Nikita, those lines will be added to the commit message:

FIXED: Memory leak in the Locate dialog
Differential Revision: https://phabricator.kde.org/D15678
This revision was automatically updated to reflect the committed changes.