D14453: Fixes memory leak of KItemListHeader

David Hallas noreply at phabricator.kde.org
Thu Feb 21 15:13:50 GMT 2019


hallas added a comment.


  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.

REPOSITORY
  R318 Dolphin

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

To: hallas
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/20190221/fa1fa356/attachment.htm>


More information about the kfm-devel mailing list