Hello folks,<br><br><br>There is a problem with appletRemoved public signal in containment. Here is the signature :<br><br>/**<br> * This signal is emitted when an applet is destroyed<br> */<br> void appletRemoved(Plasma::Applet *applet);<br>
<br>So a containment that is connected to this signal expect an Applet pointer. But who emit this signal? Our beloved base class Containment which is connected to the QObject destroyed signal of the applet.<br><br>Here is the slot :<br>
void ContainmentPrivate::appletDestroyed(QObject *object);<br><br>When we arrive in the this slot applet destructor has been already called. Since we do a static_cast just because we need the value of the pointer, it's ok. BUT after we call :<br>
<br>emit q->appletRemoved(applet); with the pointer we get after the static_cast. <br><br>Aie aie aie. Valgrind complain and we never know, people can use the pointer to do some stuff when they get the appletRemoved signal, (we already do that in our panel.cpp class). Luckily it doesn't crash but it can happen.<br>
<br>I have attach a patch that create a appletDestroyed signal that is emit just after entering in Applet destructor. I wanted to use destroyed but we have already a method called like this.<br><br>I guess if people agreed that i should backport it to 4.2 branch.<br>
<br>Is it OK?<br><br>PS : Sorry for don't using the review board but it doesn't work with git, i don't have the svn revision.<br>