O
OctavioOlguin
Guest
Tanks that it's clear and noticed, but my question goes more in this use-case: on ABL, a class is instantiated with a Byte[] defined as global to the class, then a method inside is called. This method happens to use that Byte[], does stuff on it, included, it is sended to a method that does this on it: METHOD PRIVATE STATIC MEMPTR ByteArrayToMemptr (poBytes AS "System.Byte[]":U): DEFINE VARIABLE myMemptr AS MEMPTR NO-UNDO . DEFINE VARIABLE oIntPointer AS System.IntPtr NO-UNDO . SET-SIZE (myMemptr) = poBytes:Length . oIntPointer = NEW System.IntPtr (GET-POINTER-VALUE (myMemptr)). System.Runtime.InteropServices.Marshal:Copy (poBytes, 0, oIntPointer, poBytes:Length). RETURN myMemptr. FINALLY: DELETE OBJECT oIntPointer. END FINALLY. END METHOD . and the System.IntPtr should be explicity DELETEd inside the method. Then at return, the Byte[] in question it is handled and the method returns control to UIB ABL... My question is, that Byte[], for the next iteration/use of the method, should be emptyr'd first? (or otherwise, at return from former method, asigned to ?)...
Continue reading...
Continue reading...