You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Snackbar with Message Box throws error in newer versions #2627
After version 3.1.3, if a snackbar's action is set to display a message box, and that message box is closed after the snackbar closes, the application will throw a "System.ObjectDisposedException: 'Safe handle has been closed'" exception.
Step 1
Step 2
Step 3
Step 4 (After closing the message box)
This exception is only thrown on versions after 3.1.3.
Maybe it's possible to add a bool argument to Enqueue() or a MessageQueue property to execute the older code?
There's an error in code @Keboo
SnackbarMessageQueue => CreateAndShowMessage => anonymous delegate snackbarMessage.ActionClick subscribe.
We dispose EventWaitHandle after some time and then call .Set() method on it - it's unsafe and application may shutdown immediately.
At least I suggest to add this check
if (++clickCount == 1)
DoActionCallback(messageQueueItem);
if (actionClickWaitHandle.SafeWaitHandle.IsInvalid || actionClickWaitHandle.SafeWaitHandle.IsClosed)
return;
actionClickWaitHandle.Set();
Activity
Erapchu commentedon Mar 31, 2022
There's an error in code @Keboo
SnackbarMessageQueue => CreateAndShowMessage => anonymous delegate snackbarMessage.ActionClick subscribe.
We dispose EventWaitHandle after some time and then call .Set() method on it - it's unsafe and application may shutdown immediately.
At least I suggest to add this check
Fixed long-running operations on SnackBarMessage callback (MaterialDe…
Fixed long-running operations on SnackBarMessage callback (#2627) (#2631