D16458: Fix memleaks in duchain unittests

Kevin Funk noreply at phabricator.kde.org
Sun Oct 28 17:36:32 GMT 2018


kfunk accepted this revision.
kfunk added a comment.
This revision is now accepted and ready to land.


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

INLINE COMMENTS

> test_duchain.cpp:1018
>    DUChainWriteLocker lock;
> -  contexts << new TopDUContext(IndexedString("/tmp/something"), {0, 0, INT_MAX, INT_MAX});
> +  TopDUContext * topDUConext = new TopDUContext(IndexedString("/tmp/something"), {0, 0, INT_MAX, INT_MAX});
> +  contexts << topDUConext;

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

> test_duchain.cpp:1038
> +  // TopDUContext dtor is private, only DUChain can delete it
> +  DUChain::self()->addDocumentChain(topDUConext);
> +  DUChain::self()->removeDocumentChain(topDUConext);

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.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D16458

To: buschinski, #kdevelop, kfunk
Cc: kfunk, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20181028/e7811e44/attachment.html>


More information about the KDevelop-devel mailing list