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

AwaitForAllAssets extension method calls itself causing stack overflow #394

Closed
frizenv opened this issue Aug 25, 2022 · 2 comments
Closed

Comments

@frizenv
Copy link

frizenv commented Aug 25, 2022

Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets method

        public static UniTask<UnityEngine.Object[]> AwaitForAllAssets(this AssetBundleRequest asyncOperation, CancellationToken cancellationToken)
        {
            return AwaitForAllAssets(asyncOperation, cancellationToken: cancellationToken);
        }

calls itself recursively and results in stack overflow.

It is supposed to call overloaded method, so it should look something like this:

        public static UniTask<UnityEngine.Object[]> AwaitForAllAssets(this AssetBundleRequest asyncOperation, CancellationToken cancellationToken)
        {
            return AwaitForAllAssets(asyncOperation, null, PlayerLoopTiming.Update, cancellationToken);
        }
@neuecc
Copy link
Member

neuecc commented Sep 30, 2022

You are correct, I will fix it.

neuecc added a commit that referenced this issue Oct 24, 2022
@neuecc
Copy link
Member

neuecc commented Oct 24, 2022

released at 2.3.2.

@neuecc neuecc closed this as completed Oct 24, 2022
pillsgood pushed a commit to pillsgood/UniTask that referenced this issue May 8, 2023
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

No branches or pull requests

2 participants