Skip to content
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

🐛 Fix crash on dispose while running 'RunAsync' #369

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

Saqoosha
Copy link
Contributor

@Saqoosha Saqoosha commented Aug 7, 2024

It will crash if you call Dispose while RunAsync is running.

CleanShot 2024-08-08 at 00 41 41

This PR uses SemaphoreSlim to prevent Dispose from being called while RunAsync is processing.

@asus4 asus4 merged commit ac2293d into asus4:master Aug 8, 2024
@asus4
Copy link
Owner

asus4 commented Aug 8, 2024

Thanks!

@@ -100,24 +119,37 @@ protected virtual void PreProcess(Texture texture)
protected abstract void PostProcess();

// Only available when UniTask is installed
#if TFLITE_UNITASK_ENABLED
#if TFLITE_UNITASK_ENABLED || true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, this debug flag should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry!

@Saqoosha Saqoosha deleted the fix-async-dispose-crash branch August 11, 2024 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants