[fpc-pascal] methods of an object to create others objects
md at delfire.net
Mon Jul 5 20:48:40 CEST 2010
We can to use methods of an object to create others objects, or this
is a bad programming practice?
obj1, obj2: TmyObject;
obj1 := tobj1.create; //ok
obj2 := obj1.createObj; // is this recommended?
Why I ask this:
If not exists the variable obj2 in call obj1.createObj will happen a
memory leak, right? Because there is not variable to release.
More information about the fpc-pascal