The above is mostly false; because the freed area will be re-used sometimes.
I am using a C framework but I confirm that a window allocated on the heap, still exists when the pointer goes out of scope.
I can close it successfully but it does result in some unknown exception.