Fix memleaks in duchain unittests
ClosedPublic

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

Details

Summary

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

Repository
R32 KDevelop
Lint
Lint Skipped
Unit
Unit Tests Skipped
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.

kdevplatform/language/duchain/tests/test_duchain.cpp
1018

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

1038

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.