D14453: Fixes memory leak of KItemListHeader

Elvis Angelaccio noreply at phabricator.kde.org
Sat Feb 23 17:18:13 GMT 2019


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


  In D14453#416725 <https://phabricator.kde.org/D14453#416725>, @hallas wrote:
  
  > In D14453#300180 <https://phabricator.kde.org/D14453#300180>, @elvisangelaccio wrote:
  >
  > > But why doesn't the `KItemListView` have a parent? Who deletes `listView` then?
  >
  >
  > Hi @elvisangelaccio - I have been digging a bit more into this, and the reason why the parent is nullptr at this point is because it is setup at a later point. Actually it ends up being set be KItemListController::setView function, but that only happens after the KItemListView (which is the class allocating the KItemListHeader instance) has been constructed. It essentially a Chicken-Egg problem, if you look at the constructor for DolphinView, you can see that the view is constructed before the controller, and it is actually the controller that ends up being the parent for the view. So therefore I still think this is the way to fix this small memory leak.
  
  
  Thanks for the investigation. Please put this information in the commit message, then push it :)

REPOSITORY
  R318 Dolphin

BRANCH
  fixes_leak_of_item_list_header

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

To: hallas, elvisangelaccio
Cc: elvisangelaccio, 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/20190223/0708d32b/attachment.htm>


More information about the kfm-devel mailing list