I am using automatic memory management for the c project so it is hard to tell if the window was freed when the pointer goes out of scope.

The above is mostly false; because the freed area will be re-used sometimes.
Furthermore I edited a c++ project just yesterday, I called delete on a view which was allocated on the heap using new, it had no effect whatsoever, the subviews and their listeners worked fine and it did not cause any exception which is strange.

To conclude, the freed memory is retained in both examples, if not the program would have crashed right away.