D19485: Fixes leak of DolphinFileMetaDataWidget in ToolTipManager

Elvis Angelaccio noreply at phabricator.kde.org
Sat Mar 9 18:31:25 GMT 2019


elvisangelaccio added inline comments.

INLINE COMMENTS

> hallas wrote in tooltipmanager.cpp:85-86
> I was just trying to mimic the original behavior. If there is only a single reset then there will be a short period of time where two DolphinFileMetaDataWidget instances are allocated because first the new DolphinFileMetaDataWidget is allocated, then it it passed to the reset function, which deletes the instance it owns and keeps the new one. A standard way of avoiding this is simply to call reset first without any arguments, then the original instance is deleted before the new one is allocated.
> 
> But I can change it to a single reset call, what do you think?

> If there is only a single reset then there will be a short period of time where two DolphinFileMetaDataWidget instances are allocated because first the new DolphinFileMetaDataWidget is allocated, then it it passed to the reset function, which deletes the instance it owns and keeps the new one.

Hmm, this feels like a theoretical problem only. IMHO readability and consistency of code should be preferred (we don't reset a `QScopedPointer` like this anywhere else in dolphin).

REPOSITORY
  R318 Dolphin

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

To: hallas, #dolphin, elvisangelaccio
Cc: kfm-devel, alexde, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190309/d0680ce8/attachment.htm>


More information about the kfm-devel mailing list