DRAFT document on coding conventions in kde libraries

Harald Fernengel harry at kdevelop.org
Mon Mar 13 20:06:39 GMT 2006


Hi,

On Monday 06 March 2006 15:17, André Wöbbeking wrote:
> Don't access member variables after emitting signals as the receiver
> could delete the object. If you really have to do it then document that
> the object must not be deleted in connected slots.

...or use the following pattern:

QPointer guard(this);
emit mySignal();
if (!guard)
    return; // this object has been deleted

Harald




More information about the kde-core-devel mailing list