Review Request 121436: grepview: fix two crashes

Nicolai Hähnle nhaehnle at gmail.com
Wed Dec 10 19:53:59 UTC 2014



> On Dez. 10, 2014, 4:21 nachm., Milian Wolff wrote:
> > plugins/grepview/grepdialog.cpp, line 468
> > <https://git.reviewboard.kde.org/r/121436/diff/1/?file=332561#file332561line468>
> >
> >     instead, please use the newer connect (afaik added in Qt 5.3):
> >     
> >         connect(toolView, &GrepOutputView::outputViewIsClosed,
> >         job, [] { job->kill(); });
> >     
> >     Also, couldn't it be rewritten to:
> >     
> >         connect(toolView, &GrepOutputView::outputViewIsClosed,
> >         job, &GrepJob::kill);
> >     
> >     Maybe some casts are required?
> 
> Aleix Pol Gonzalez wrote:
>     Agreed, second option should work and looks quite elegant.

KJob::kill takes one argument with a default value, which -- as far as I understand it -- is why the suggestion (which I like and actually tried first) did not compile. If there's a way to convince the Qt magic to call kill anyway with the default value, that would be nice indeed.


- Nicolai


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


On Dez. 10, 2014, 3:22 nachm., Nicolai Hähnle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121436/
> -----------------------------------------------------------
> 
> (Updated Dez. 10, 2014, 3:22 nachm.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> The first crash is a crash-on-exit, when the kill() method of a no longer existing job is called. Guard againsts this crash by using a QPointer.
> 
> The second crash happens when GrepOutputDelegate::sizeHint() is called while using the combo-box of the grep output view to switch to previous search results. Simply change the code to be more defensive.
> 
> 
> Diffs
> -----
> 
>   plugins/grepview/grepdialog.cpp bb00e47 
>   plugins/grepview/grepoutputdelegate.cpp bcd911b 
> 
> Diff: https://git.reviewboard.kde.org/r/121436/diff/
> 
> 
> Testing
> -------
> 
> manual testing / daily use
> 
> 
> Thanks,
> 
> Nicolai Hähnle
> 
>

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


More information about the KDevelop-devel mailing list