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

Aaron Seigo aseigo at kde.org
Tue Apr 6 19:34:29 CEST 2010


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



/trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/dbussystemtray/dbussystemtrayprotocol.cpp
<http://reviewboard.kde.org/r/3505/#comment4377>

    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().


- Aaron


On 2010-04-06 16:49:20, Matthieu Gallien wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3505/
> -----------------------------------------------------------
> 
> (Updated 2010-04-06 16:49:20)
> 
> 
> 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/manager.cpp 1110082 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/core/task.cpp 1110082 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/dbussystemtray/dbussystemtrayprotocol.cpp 1110298 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/fdo/fdoselectionmanager.cpp 1110082 
>   /trunk/KDE/kdebase/workspace/plasma/generic/applets/systemtray/protocols/fdo/fdotask.h 1110082 
> 
> 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