delete pointerToWidget;
if (pointerToWidget){ delete pointerToWidget; pointerToWidget = NULL; }
C++ (Qt)if( ptr ){ if(ptr ) { delete ptr; ptr = 0; } ptr = 0;}