Might be a stupid question, but if I create a console-application that dynamicly creates object and such, I make sure to free the memmory at shutdown. What happens if a user closes the application with the “x” button on the window? will there be memoryleaks and if so, how do i prevent it?
Might be a stupid question, but if I create a console-application that dynamicly creates
Share
No, there won’t be any memory leaks.
When a user closes your application the process in which your appication runs gets terminated.Once a process gets terminated, the Operating System(OS) simply reclaims all the memory it had allocated to the process.
Note that for an OS there is no importance whether memory was leaked by the application or not it is simply reclaiming what it allocated to the process.