-
-
Notifications
You must be signed in to change notification settings - Fork 46
Dialog response await will never continue if reuse same instance two times, but works OK if another instance shown between #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem seems to be here: SampSharp/src/SampSharp.GameMode/Tools/ASyncWaiter`2.cs Lines 62 to 69 in c88d53f
The user shows dialogA and awaits response. What if we swap the lines 67 and 68? |
I changed the lines 67-68 to: var task = _completionSources[key];
Remove(key);
task.SetResult(arguments); And 80-81 to: var task = _completionSources[key];
Remove(key);
task.TrySetCanceled(); And the problem gone, all seems to work all OK, I will test more time and report. |
Let say we have 2 dialog instances:
Now this code will fail (the dialog A will show two times, but second await will never continue):
But this one will work as expected:
The text was updated successfully, but these errors were encountered: