Dolphin crash fix

Peter Penz peter.penz at gmx.at
Sun Dec 9 12:57:51 GMT 2007


Hi Rafael,

On Sunday, 9. December 2007 12:48, Rafael Fernández López wrote:
> Following my personal fixing marathon, I have found that Dolphin crashes
> when you close it and you had a selection.
>
> Mainly, it is because of:
>
>     connect(m_dirLister, SIGNAL(clear()),
>             this, SLOT(updateStatusBar()));
>
> When you trigger on the destructor "delete m_dolphinModel;", it will call
> the dirlister clear signal, what will result that you later access to
> memory that has been already deleted.
>
> So, as usually to proceed when we have signals and slots being used with
> this kind of objects, we can use deleteLater() what will safely delete it
> when the events process runs again.
>
> Patch attached. OK to commit ?

I've committed 2 patches yesterday which fixed the same issue. In the first 
patch I also used deleteLater(), but David pointed out that it gets tricky to 
find out memory leaks by using deleteLater() in the shutdown process. So in 
the second patch I used 'delete' again, but assured that the directory lister 
disconnects all signals in the destructor of the view-container. I think this 
works now very well... As in my patch also another memory leak is fixed (I 
did not release the proxy model), I'd propose that we leave it as it is. Is 
this OK for you?

I'm sorry that we worked on the same issue, I hope you did not spend too much 
time on this issue :-/

Thanks for your ongoing support!
Peter




More information about the kfm-devel mailing list