Review Request: Change the way dbus and fdo tasks are destroyed

Matthieu Gallien matthieu_gallien at yahoo.fr
Tue Apr 6 22:09:54 CEST 2010



> On 2010-04-06 17:34:33, Aaron Seigo wrote:
> > /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/dbussystemtray/dbussystemtrayprotocol.cpp, line 92
> > <http://reviewboard.kde.org/r/3505/diff/2/?file=22631#file22631line92>
> >
> >     afaict from reading the code, this is the line that is incorrect. this patch just works around that fact.
> >     
> >     my guess is that this was done this way because deleteLater() schedules the deletion for the next trip through the event loop.
> >     
> >     what's probably needed here is a new method in Task that does this:
> >     
> >     void Task::destroy()
> >     {
> >         emit destroyed(this);
> >         deleteLater();
> >     }
> >     
> >     then make the destructor of Task private to ensure that all deletions must be replaced with cals to destroy().

I did the changes you suggested but I do not really understand what you mean.
What was causing me troubles is that if I was waiting for the signal emission fro the Task destructor, then I get crashes in the Manager::removeTask method.
Does your suggestion is referring to this ?


- Matthieu


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3505/#review4897
-----------------------------------------------------------


On 2010-04-06 19:45:35, Matthieu Gallien wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3505/
> -----------------------------------------------------------
> 
> (Updated 2010-04-06 19:45:35)
> 
> 
> Review request for Plasma, Aaron Seigo and Marco Martin.
> 
> 
> Summary
> -------
> 
> Try to make dbus and fdo tasks have the same life cycle. Now the Manager class is responsible for calling deleteLater. Make DBus tasks emits only once the destroyed signal.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/core/task.cpp 1111824 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/dbussystemtray/dbussystemtrayprotocol.cpp 1111824 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/fdo/fdoselectionmanager.cpp 1111824 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/fdo/fdotask.h 1111824 
> 
> Diff: http://reviewboard.kde.org/r/3505/diff
> 
> 
> Testing
> -------
> 
> Tested with dbus and fdo tasks inside a kde 4.4.2 session and Qt 4.6.2. Nothing crash.
> 
> 
> Thanks,
> 
> Matthieu
> 
>



More information about the Plasma-devel mailing list