03-19-2022, 12:19 PM
(This post was last modified: 03-19-2022, 12:20 PM by Alexandre Machado.)
I tested the sample application and the behavior is determined by Indy threads.
The user is creating a new window when the application receives an incoming request. Indy will spawn a new thread for it.
This new window is owned by the Indy worker thread. As soon as the request is processed in the async event, the thread is freed so are the owned windows.
That's why the window handle becomes invalid.
BTW: the same problem doesn't happen in Http.sys IW application because there are a fixed number of worker threads that are not destroyed.
The user is creating a new window when the application receives an incoming request. Indy will spawn a new thread for it.
This new window is owned by the Indy worker thread. As soon as the request is processed in the async event, the thread is freed so are the owned windows.
That's why the window handle becomes invalid.
BTW: the same problem doesn't happen in Http.sys IW application because there are a fixed number of worker threads that are not destroyed.