Delete() function or not, the programmer always has the ability to hang themselves. Delete() at best can set every variable referencing that instance to Null for the programmer, but it cannot make the actual variables disappear. without the programmer checking for Null in all routines that could use a reference variable to that type instance after its been Delete()d, an error will occur anyway. so, it can be said that its good programming practice to always check for an instance pointer being Null before using it if there is any chance that it can be Null. to extend this for the TWindow example given, add a Method called IsValid() to TWindow that will return false if handle is 0. so now your check for Null becomes something like:
chances are that if the programmer is trying to use a variable that is no longer valid in some way, then they probably want to know about it anyway since it is more than likely a bug in program flow.
If Not MyWindow Or Not MyWindow.IsValid() Then RuntimeError "Oops"
chances are that if the programmer is trying to use a variable that is no longer valid in some way, then they probably want to know about it anyway since it is more than likely a bug in program flow.