Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

[#608] Fixed reuse issue with WrappingInjectorProvider #616

Merged
merged 1 commit into from
Jan 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ public WrappingInjectorProvider(IInjectorProvider delegate) {
this.delegate = delegate;
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
this.injector = createInjector();
if (delegate instanceof IRegistryConfigurator) {
Copy link
Member Author

Choose a reason for hiding this comment

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

is it correct to call this AFTER createInjector?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope inverting also seems to break other stuff

((IRegistryConfigurator) delegate).setupRegistry();
}
registerFactory(injector);
stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (delegate instanceof IRegistryConfigurator) {
((IRegistryConfigurator) delegate).restoreRegistry();
}
}

private void registerFactory(Injector injector) {
Expand Down