Review Request: Do not leak kdeuiwidgetsproxystyle

Christoph Feck christoph at maxiom.de
Fri Oct 8 12:25:23 BST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5549/#review8034
-----------------------------------------------------------


Nice catch, but it cannot be fixed at that place. If you are setting the same proxy style to multiple widgets, deleting the first of them would delete the proxy style. So it should be decided per subclass what to do.

The proper fix is to apply your patch inside KLineEditStyle (klineedit_p.h:189). This is also how the KHTMLProxyStyle does it.

- Christoph


On 2010-10-08 10:07:23, Boudewijn Rempt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5549/
> -----------------------------------------------------------
> 
> (Updated 2010-10-08 10:07:23)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> For instance in KLineEdit::init(), we have a line like:
> 
> d->style = new KLineEditStyle(this);
> 
> This gives the impression that KLineEditStyle has QObject-based parent-child relation and will be deleted automatically. That wasn't true, because QStyle while being a QObject doesn't have a QObject* parent paramater in its constructor. So this patch sets the parent explicitly in KdeUiProxyStyle 
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdelibs/kdeui/widgets/kdeuiwidgetsproxystyle.cpp 1182756 
> 
> Diff: http://svn.reviewboard.kde.org/r/5549/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Boudewijn
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20101008/101affe0/attachment.htm>


More information about the kde-core-devel mailing list