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

The "PerResolve" lifetime is not properly respected when the resolving interception behaviors for an object #44

Open
MikeCook9994 opened this issue Apr 25, 2023 · 0 comments

Comments

@MikeCook9994
Copy link

I've noticed some recent activity on these repos so I'm going to shoot my shot.

I am upgrading some code (that's an understatement) from Unity 3 to Unity 5 and have encountered what is either a bug or a significant behavioral difference regarding interception between the versions.

In Unity 5.11 (and likely earlier versions, I haven't explored deep enough to find where the issue starts), Unity will re-resolve objects registered with the "PerResolveLifetimeManager" when resolving objects needed for any defined interception behavior. I have verified that the same object will be used across the object graph for any reference that is not part of interception behavior.

Here is a test case that should demonstrate the issue. I tried another lifetime ("PerThread") to demonstrate that it does seem to specifically be an issue with "PerResolve".

UnityPerResolveInterceptionBrokenPoc.zip

I've pulled the interception repo and have been trying to uncover the issue, but I'm quite a bit out of my depth. Depending on the scope of the fix (I would have to evaluate fixing this vs other options for my team to consider), I'd be willing to submit a PR if I can get pointed in the right direction.

@MikeCook9994 MikeCook9994 changed the title The "PerResolve" lifetime is not properly respected when the resolving interception behaviors for an object. The "PerResolve" lifetime is not properly respected when the resolving interception behaviors for an object Apr 25, 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

1 participant