<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Aug 26, 2015 at 5:38 AM, Christoph Feck <span dir="ltr"><<a href="mailto:cfeck@kde.org" target="_blank">cfeck@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wednesday 26 August 2015 11:27:05 Leslie Zhai wrote:<br>
> Git commit 4e9b32d80d6b43ad3d1ddd47c948ad066608b052 by Leslie<br>
Zhai.<br>
> Committed on 26/08/2015 at 09:24.<br>
> Pushed by lesliezhai into branch 'master'.<br>
><br>
> plasma: Fix applet actions might be nullptr<br>
> BUG:351777<br>
><br>
> M  +1    -1    src/plasma/applet.cpp<br>
><br>
> <a href="http://commits.kde.org/plasma-framework/4e9b32d80d6b43ad3d1ddd47c94" rel="noreferrer" target="_blank">http://commits.kde.org/plasma-framework/4e9b32d80d6b43ad3d1ddd47c94</a><br>
> 8ad066608b052<br>
><br>
> diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp<br>
> index 895555c..3716a83 100644<br>
> --- a/src/plasma/applet.cpp<br>
> +++ b/src/plasma/applet.cpp<br>
> @@ -568,7 +568,7 @@ QList<QAction *> Applet::contextualActions()<br>
><br>
>  KActionCollection *Applet::actions() const<br>
>  {<br>
> -    return d->actions;<br>
> +    return d->actions ? d->actions : new<br>
> KActionCollection((QObject *)this); }<br>
><br>
>  Types::FormFactor Applet::formFactor() const<br>
<br>
Doesn't this leak memory? I doubt the caller of Applet::actions() is<br>
supposed to delete the received pointer.<br></blockquote><div><br></div><div>It does I think. It should be assigned back to d->actions however if</div><div>d->actions is null here, there's something else wrong because the</div><div>default d->actions collection is created in ::Private constructor. So</div><div>while this patch does fix the crash, I don't think it's the correct fix.</div><div><br></div><div>It would certainly help if Leslie provided some explanation for this</div><div>patch.</div><div><br></div><div>Leslie?</div><div><br></div><div>Can we also please ask to have patches submitted to reviewboard</div><div>first?</div></div><div><br></div><div>Cheers</div>-- <br><div class="gmail_signature"><div><span style="color:rgb(102,102,102)">Martin Klapetek | KDE Developer</span></div></div>
</div></div>