Forum Post: OOABL and cleaning up handles

  • Thread starter Thread starter asthomas
  • Start date Start date
Status
Not open for further replies.
A

asthomas

Guest
A question for the OOABL experts out there... OE 11.3.2 I have some OOABL code that has been updated so that method output parameters returning handles for temp-table, datasets etc. have been changed to use return values on the methods instead. e.g. METHOD PUBLIC VOID rtbGetWorkspace( INPUT pcWorkspaceId AS CHARACTER, OUTPUT TABLE-HANDLE phTT ): RUN rtb/proxy/p/rtbGetWorkspace.p ON AppServerHandle ( INPUT pcWorkspaceId, OUTPUT TABLE-HANDLE phTT). RETURN. FINALLY: DELETE OBJECT phTT NO-ERROR. END FINALLY. END METHOD. Has been changed to: METHOD PUBLIC HANDLE rtbGetWorkspace( INPUT pcWorkspaceId AS CHARACTER): DEFINE VARIABLE hTT AS HANDLE NO-UNDO. RUN rtb/proxy/p/rtbGetWorkspace.p ON AppServerHandle ( INPUT pcWorkspaceId, OUTPUT TABLE-HANDLE hTT). RETURN hTT. END METHOD. Initially, I had the DELETE OBJECT code in the FINALLY of the updated method. But this resulted in the code not working any more, as the returned hTT handle was then ?. Is it correct that it is not longer necessary to delete handles explicitly to avoid memory leaks in use cases like this? TIA

Continue reading...
 
Status
Not open for further replies.
Back
Top