Review Request 128874: Free QFileDialog memory

Łukasz Wojniłowicz lukasz.wojnilowicz at gmail.com
Sat Sep 10 08:42:39 UTC 2016



> On Wrz 10, 2016, 10:28 rano, Thomas Baumgart wrote:
> > kmymoney/plugins/csvimport/csvwizard.cpp, line 775
> > <https://git.reviewboard.kde.org/r/128874/diff/2/?file=476668#file476668line775>
> >
> >     From the docs at http://doc.qt.io/qt-5/qlayout.html#addItem which is called by dialog->layout()->addWidget(x), the ownership of x is transferred to the layout. Doesn't that mean, that deleting the dialog takes care of the destruction of comboBoxEncode and label?

I agree and removed
```c++
delete comboBoxEncode;
delete label;
```
but "The program has unexpectedly finished." even when I make basic QFiledialog with only DontUseNativeDialog set.


- Łukasz


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


On Wrz 10, 2016, 9:59 rano, Łukasz Wojniłowicz wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128874/
> -----------------------------------------------------------
> 
> (Updated Wrz 10, 2016, 9:59 rano)
> 
> 
> Review request for KMymoney.
> 
> 
> Repository: kmymoney
> 
> 
> Description
> -------
> 
> After closing CSV Importer in the middle and then KMyMoney, I get "The program has unexpectedly finished".
> The problem doesn't occur if CSV Importer goes all way through to the last page; then I can go back and close it wherever I want.
> If I comment out this line, there is no problem at all.
> ```c++
>   QPointer<QFileDialog> dialog = new QFileDialog(this, QString(),
>                                                  fileInfo.absoluteFilePath(),
>                                                  i18n("*.csv *.PRN *.txt | CSV Files\n *|All files"));
> ```
> Memory on which dialog pointed wasn't deleted in the method and it obviously need to be deleted, but the problem remains. Does anyone know how to prevent QtCreator from showing "The program has unexpectedly finished" here?
> 
> 
> Diffs
> -----
> 
>   kmymoney/plugins/csvimport/csvwizard.h ecec5b0 
>   kmymoney/plugins/csvimport/csvwizard.cpp b576dea 
> 
> Diff: https://git.reviewboard.kde.org/r/128874/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Łukasz Wojniłowicz
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20160910/b5611bb7/attachment.html>


More information about the KMyMoney-devel mailing list