Does PostQuitMessage(0) deallocates all the memory allocated for widgets in main thread?

Harshithraj1871 1,516 Reputation points
2024-05-30T12:30:26.29+00:00

Hi,

I'm working on a CPP win32 application. We are developing a multi windowed application. When we want to force quit the application, we use PostQuitMessage(0) which stops the event loop and all the window visible will be closed.

But by doing this will the memory allocated for the widgets and windows be destroyed? Or is it assumed that the thread will exit and allocated memory is taken care of by thread exit?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,492 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 42,366 Reputation points
    2024-05-30T12:58:28.27+00:00

    If your application terminates after the message loop is exited then the system will clean up all of the resources that were allocated by the application. By itself, PostQuitMessage does not do resource cleanup.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful