RunCode() ? 'Cycle 2' RunCode() FUNCTION RunCode() * IF YOU USE persistent reference, C5 AND MEMORY LEAK DISAPPEAR LOCAL oObjectFactory as Object, oProducedObject as Object oObjectFactory = CREATEOBJECT("ObjectFactory") oProducedObject = oObjectFactory.ReturnAnObject() && Fabio && with every thing else the same this line of code not cause C5's && this will also fix the corrupt memory problem. oObjectFactory = .null. && Comment out the previous line of code C5's return && End of comment to Fabio ENDFUNC DEFINE CLASS ObjectFactory as Custom oObjectRef = "" FUNCTION ReturnAnObject() as Object LOCAL oObjectRef as Object oObjectRef = CREATEOBJECT("ProducedObject") && the C5 is fired here !!! ? 'PUNTO 2' oObjectRef.Configuration = M.THIS RETURN M.oObjectRef ENDFUNC ENDDEFINE DEFINE CLASS ProducedObject as Custom Configuration = "" DIMENSION MemberArray1(1) DIMENSION MemberArray2(1) DIMENSION MemberArray3(1) DIMENSION MemberArray4(1) DIMENSION MemberArray5(1) DIMENSION MemberArray6(1) FUNCTION Configuration_Assign(oObjectRef as object) ENDFUNC ENDDEFINEMemory leak code:
RunCode() ? 'Cycle 2' RunCode() FUNCTION RunCode() * IF YOU USE persistent reference, C5 AND MEMORY LEAK DISAPPEAR LOCAL oObjectFactory as Object, oProducedObject as Object oObjectFactory = CREATEOBJECT("ObjectFactory") oProducedObject = oObjectFactory.ReturnAnObject() ENDFUNC DEFINE CLASS ObjectFactory as Custom oObjectRef = "" FUNCTION ReturnAnObject() as Object LOCAL oObjectRef as Object oObjectRef = CREATEOBJECT("ProducedObject") && the C5 is fired here !!! ? 'PUNTO 2' oObjectRef.Configuration = M.THIS RETURN M.oObjectRef ENDFUNC ENDDEFINE DEFINE CLASS ProducedObject as Custom Configuration = "" && Fabio && with this class definition C5's will not appear but && will cause a huge Memory leak. && End of comments to Fabio DIMENSION MemberArray1(1) DIMENSION MemberArray2(1) DIMENSION MemberArray3(1) FUNCTION Configuration_Assign(oObjectRef as object) ENDFUNC ENDDEFINEThanks Fabio