When using TScHubConnection in dll, the main window closes and gets stuck.

When using TScHubConnection in dll, the main window closes and gets stuck.

I use TScHubConnection in the dll loaded by the exe to connect to the server. When the exe is closed, the window freezes directly and the process must be forced to end. I tried modifying the EventsCallMode, all modes have no effect. Help!