atomicobject / objection

A lightweight dependency injection framework for Objective-C
http://www.objection-framework.org
MIT License
1.85k stars 223 forks source link

Fixed retain cycle in injector #36

Closed nickynick closed 11 years ago

nickynick commented 11 years ago

Hey! I'm using Objection in a complex setup which involves switching injectors. I noticed then that something was preventing injectors from being deallocated. I did a little research and found a retain cycle. __JSObjectionInjectorDefaultModule is retaining an injector, while it itself is stored inside the injector in _modules array. Cheers :)

jdewind commented 11 years ago

Indeed, this was certainly an oversight. The injector should be weakly referenced by the module.