Fix memleaks in duchain unittests

Authored by buschinski on Oct 27 2018, 2:16 PM.



The TypeSystem::create test was changed as now the destruction is also taken into account for QBENCHMARK

The TopDUContext dtor is protected, however you can execute
delete TopDUContext; but it will NOT call the protected TopDUContext dtor but the public DUContext dtor.

Test Plan
  • compile kdevelop unitest with ASAN&LSAN
  • execute test_duchain

Diff Detail

R32 KDevelop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
buschinski created this revision.Oct 27 2018, 2:16 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptOct 27 2018, 2:16 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
buschinski requested review of this revision.Oct 27 2018, 2:16 PM
kfunk accepted this revision.Oct 28 2018, 5:36 PM
kfunk added a subscriber: kfunk.

Feel free to push to 5.3 branch after fixing my remarks.


auto* topDUContext = ... (notice also the typo)


Is it possible to add the document chain right after the TopDUContext creation (i.e. to move this code right after it)? Would look a bit cleaner.

This revision is now accepted and ready to land.Oct 28 2018, 5:36 PM
buschinski updated this revision to Diff 44467.Oct 29 2018, 9:43 PM
  • changed as requested, will push tomorrow or so

thx for the review :)

This revision was automatically updated to reflect the committed changes.