>When an EXE calls another EXE such as Main.exe calling Sub.exe, I would like to know the proper way to cleaning a class from memory. In Sub.exe, I have a DEFINE CLASS... As soon as one CREATEOBJECT() is done on that class, the EXE remain locked in memory.
>
>My DEFINE CLASS is like this:
>
>
>DEFINE CLASS MyClass AS RELATION
>cProperty1=''
>cProperty2=''
>
>FUNCTION Method1
>ENDFUNC
>
>ENDDEFINE
>
>
>Then, when I call this class from Sub.exe, it goes like this:
>
>
>LOCAL loMyClass
>loMyClass=CREATEOBJECT('MyClass')
>loMyClass.Method1()
>
>
>So, the loMyClass is local. Basically, as soon as the process is over, loMyClass it out of memory. However, something gets stuck in it in regards to the class. What am I missing?
So after the loMyClass.Method1() call, that program ends? What you should do is after the method call, set loMyClass = .NULL. to clear it from memory.
Randy