This is just standard C++ memory management. It depends on where and how you use it. For windows that are to be short lived (e.g. modal QDialogs) then you can create them on the stack and they are automatically cleaned up as they go out of scope. If you allocate the memory on the heap with new then you must ensure that delete is called at some point. Usually the destructor of the allocating class is the correct place. Another option is to use one of the "smart" pointers: QScopedPointer or QSharedPointer.
Bookmarks