Have some .net assembly, calling it in delphi through COM.
var
intf: ITest;
...
intf:= CreateComObject(CLASS_TEST) as ITest;
...
//here comes some stuff
...
Must i do something to destruct it to free memory. Or not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should better release the memory with
When you don’t need it any more. Better with a
try...finally intf := nil;block, or in theDestroyoverriden method ifintfis defined asfIntf, i.e. as a class property.If
intfis defined on stack, it will we freed automatically at the end of the method. There is an hiddentry...finally intf := nil; endblock generated by the compiler to free theintfinstance.