Jump to content
Sign in to follow this  
Jacek Laskowski

Spring, factory and object release

Recommended Posts

I register classes and factories in Spring:

 

container.RegisterType<TMyClass>;
container.RegisterFactory<TMyClassFactory>;


Then in the code I use:
 

 fClassFactory: TMyClassFactory;

[...]  
  
begin
  lMyClass: = fClassFactory();
  [some code]
  lMyClass.Free; <- who is responsible?
end;



Who is responsible for the release of the object? Spring or me?

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×