private: QLabel * _label;
_label = new QLabel (this);
if (_label) { delete _label; _label = 0;}
delete _label;_label = 0;
QGuardedPtr<QLabel> label = new QLabel( 0, "label" ); label->setText( "I like guarded pointers" ); delete (QLabel*) label; // simulate somebody destroying the label if ( label) label->show(); else qDebug("The label has been destroyed");