No, the destructor is not called. The OS typically frees all the resources it tracks, such as memory and open file descriptors, but that's all. If, for instance, the destructor of your main window saves some data to a configuration file, you need the destructor to be called, e.g. with delete.
More generally, it is good practice to explicitly release the resources you allocate. If you want to allocate the main window on the heap and still have it automatically deleted at the end of the enclosing scope, consider wrapping the pointer in a smart pointer, such as std::unique_ptr.
Bookmarks