[Kde-games-devel] Review Request 126383: Use of QScopedPointer for avoiding crashy dialogs.

Christian Ehrlicher ch.ehrlicher at gmx.de
Wed Dec 16 17:05:29 UTC 2015


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


I'm sorry but this is still wrong. Did you read this blog: https://blogs.kde.org/node/3919
You somehow have to notice the the dialog gets deleted during exec(). This is only possible with a QPointer. After exec() when you want to access the pointer, you've to check if the QPointer is null before accesing them:

QPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog(q));
dialog->exec();
if (dialog)
{
   dialog->getValues();
}
delete dialog;

- Christian Ehrlicher


On Dez. 16, 2015, 11:33 vorm., Frederik Schwarzer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126383/
> -----------------------------------------------------------
> 
> (Updated Dez. 16, 2015, 11:33 vorm.)
> 
> 
> Review request for KDE Games.
> 
> 
> Repository: libkdegames
> 
> 
> Description
> -------
> 
> I recently found out about QScopedPointer and thought it might be a good thing to use instead of QPointer in many cases.
> So I tested it with two crashy dialogs in libkdegames.
> Please comment in case I forgot to think about something.
> 
> 
> Diffs
> -----
> 
>   kgthemeselector.cpp 9cd9c61 
>   libkdegamesprivate/kgamethemeselector.cpp ce3cf1f 
> 
> Diff: https://git.reviewboard.kde.org/r/126383/diff/
> 
> 
> Testing
> -------
> 
> Used the KNS3 dialog in Kigo.
> 
> 
> Thanks,
> 
> Frederik Schwarzer
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20151216/8822bd13/attachment.html>


More information about the kde-games-devel mailing list