Review Request 114921: Make KFileItemActions the parent of the actions it creates

Alexander Richardson arichardson.kde at googlemail.com
Thu Jan 9 19:42:01 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114921/#review47125
-----------------------------------------------------------


Why not simply make the QMenu* the parent of the QAction?
I am not familiar with the code so I may be missing something, but won't makeing KFileItemActions the parent mean that the actions only get deleted once the KFileItemActions gets deleted?
I guess this could waste quite a bit of memory. 

- Alexander Richardson


On Jan. 9, 2014, 9:15 a.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/114921/
> -----------------------------------------------------------
> 
> (Updated Jan. 9, 2014, 9:15 a.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> This patch is a result of the discussion in http://lists.kde.org/?t=138687009400001&r=1&w=2
> 
> Currently, KFileItemActions makes the widget that is set with setParentWidget(QWidget*) the parent not only of any dialogs that are shown (as advertised by the API docs), but also of the created actions. Nonetheless, KFileItemActions remembers pointers to all created actions and deletes them in the destructor. This can cause problems if the widget is deleted before the KFileItemActions instance - the destructor will then try to delete dangling pointers and cause a crash.
> 
> This problem can be fixed by making KFileItemActions the parent of the actions. This also makes the code a bit simpler because the m_ownActions member is not needed any more.
> 
> In fact, this issue is the cause of crashes in Dolphin (see https://bugs.kde.org/show_bug.cgi?id=259089). I still think that we don't really have to change it in kdelibs 4.x because the problem can be worked around (https://git.reviewboard.kde.org/r/114440/ , which isn't pushed yet because it turns out that there is still another source of crashes in the problematic Dolphin use case).
> 
> 
> Diffs
> -----
> 
>   autotests/CMakeLists.txt 2868327 
>   autotests/kfileitemactionstest.cpp PRE-CREATION 
>   src/widgets/kfileitemactions.cpp eee2ebe 
>   src/widgets/kfileitemactions_p.h 9f9a701 
> 
> Diff: https://git.reviewboard.kde.org/r/114921/diff/
> 
> 
> Testing
> -------
> 
> New unit test crashes with master, and passes if the patch is applied.
> 
> Existing kio unit tests pass on my system (except for kiocore-kacltest, but I believe that the failure is unrelated to this patch).
> 
> 
> Thanks,
> 
> Frank Reininghaus
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140109/d73def7f/attachment.html>


More information about the Kde-frameworks-devel mailing list