I’m working in c++ and have a modeless dialog that is responsible for communicating with a thread (ui pulls updates from it - same lifespan as ui). When I close the dialog normally, I can shut the thread down cleanly. If I leave the dialog hanging and close Rhino, my thread doesn’t terminate properly. When OnDestoy() fires when closing down Rhino, it looks like it is forcing the thread to terminate and that creates leaks for me. OnDestroy() is also being called before OnUnLoadPLugin - I tried to do some handling in there, and also worked with threading calls in the ui (SwitchToThread(), Sleep(0), WaitForSingleObject), but no joy. I was wondering if there is a way to signal the dialog before it gets OnDestroy() called when Rhino shuts down? I need to be able to switch focus to the other thread so it can terminate cleanly.