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

Decorators binding managed interfaces #64

Open
lostlont opened this issue Nov 14, 2022 · 0 comments
Open

Decorators binding managed interfaces #64

lostlont opened this issue Nov 14, 2022 · 0 comments

Comments

@lostlont
Copy link

Describe the bug
Binding objects implementing IInitializable or IDisposable makes them initialized/disposed by the kernel. Binding a decorator via Container.Decorate<TContract>().With<TDecorator>() decorates an already bound object. But binding a decorator which implements any of the former interfaces will not register them to the corresponding manager of the kernel.

To Reproduce
Bind a type via an interface. Then on top of that interface bind a decorator which implements IInitializable or IDisposable.

Expected behavior
Expected Initialize() and Dispose() methods of the decorator to be invoked, but these are not invoked, even if other methods implemented by the interface is properly decorated.

Extenject and Unity info (please complete the following information):

  • Zenject version: latest master (cc02082)
  • Unity version: 2021.3.13f1
  • Project's scripting backend: both Mono/IL2CPP
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