Review Request 128016: [OS X] Prevent a crash in the IdealDockWidget's context menu

Sven Brauch mail at svenbrauch.de
Tue Jun 14 15:10:52 UTC 2016



> On June 2, 2016, 9:22 p.m., Milian Wolff wrote:
> > sublime/idealdockwidget.cpp, line 117
> > <https://git.reviewboard.kde.org/r/128016/diff/3/?file=465501#file465501line117>
> >
> >     dito with the comma. and using this + qscopedpointer? you can remove the `this`, no?
> 
> René J.V. Bertin wrote:
>     Actually I *must* replace it, with a NULL ptr (QActionGroup requires an explicit parent). I'm not exactly sure why but given `this` as a parent leads to a systematic crash when g goes out of scope after removing a toolview. Maybe that the `this` object is discarded at that moment, leading to the immediate deletion of the QActionGroup instead of disposing it via deleteLater?

By passing a parent _and_ using QScopedPointer, you're using two conflicting memory management mechanisms, which is just wrong imo. And unnecessary.


- Sven


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


On May 26, 2016, 3:34 p.m., René J.V. Bertin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128016/
> -----------------------------------------------------------
> 
> (Updated May 26, 2016, 3:34 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> OS X can be capricious when instances corresponding to a widget are deleted, if the class in question uses "native" ObjC SDKs behind the scenes. Pending events can in that case be (generated and) delivered to objects that were already deleted.
> According to the documentation, one should prefer to use `QObject::deleteLater()` rather than the regular, direct `delete` whether it be explicit or implicit.
> 
> I've long used a local patch that uses this approach in order to prevent a recurring crash after using the context menu of the "ideal dock widget". Somehow I never put it up for review here, apparently.
> 
> 
> Diffs
> -----
> 
>   sublime/idealdockwidget.cpp dae0ea2 
> 
> Diff: https://git.reviewboard.kde.org/r/128016/diff/
> 
> 
> Testing
> -------
> 
> Builds and permits reliable behaviour on both OS X and Linux.
> 
> 
> Thanks,
> 
> René J.V. Bertin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160614/ba7041e7/attachment.html>


More information about the KDevelop-devel mailing list