Awesome! Perfect, I'll null 'em then.
I think it might be useful to be able to remove rules. Even if just
for "completeness" sake (although I certainly have real uses for it).
Cheers,
On Mar 23, 10:13 am, Josh McDonald <
j...@joshmcdonald.info> wrote:
> For 1 & 2, the new rule should overwrite the old, and someObj should become
> available for garbage collection.
>
> You can overwrite the rule with useInstance(null) and the injector should no
> longer hold a reference to someOtherObj. There's currently no way to
> "delete" a rule, but that'd be very easy to add...
>
> -Josh
>
> 2009/3/23 dtyrell <
Dars...@gmail.com>
>
>
>
>
>
> > Greetings,
>
> > 3 new questions today:
>
> > 1) Do duplicate rules on the same Injector get "overwritten"?
>
> > injector.newRule().whenAskedFor( SomeClass ).useInstance( someObj );
> > injector.newRule().whenAskedFor( SomeClass ).useInstance
> > ( someOtherObj );
>
> > 2) Assuming there are no other references to someObj, will it be free
> > for Garbage Collection at this point?
>
> > 3) How might I free someOtherObj for GC later?
>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> Josh 'G-Funk' McDonald
> -
j...@joshmcdonald.info