QAction calls an async method and gets stuck. I tried canceling the async method using timeout and CancellationToken, but the QAction is still on the stack. Is there any way I can remove it from the stack?
With the help of Floris, this problem seems to have been solved.
At the moment everything looks OK, we will monitor the situation for a few more days.
The solution was to add a CancellationTokenSource with a TimeSpan of 30s and modify the async method call from:
AsyncPump.Run(AsyncMethod, tokenSource.Token)
to:
var t = Task.Factory.StartNew(() => AsyncPump.Run(AsyncMethod, tokenSource.Token), tokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
t.Wait(tokenSource.Token);
Thanks Floris!