sonar-openedge
sonar-openedge copied to clipboard
False positive: Dynamic object leak
The following code is incorrectly being flagged:
DEFINE VARIABLE hds AS HANDLE NO-UNDO.
DEFINE VARIABLE ht AS HANDLE NO-UNDO.
CREATE DATASET hds.
CREATE TEMP-TABLE ht. // <-- Memory allocated to this object is not released in this code block
ht:ADD-NEW-FIELD( 'bar':u, 'int':u ).
ht:TEMP-TABLE-PREPARE( 'foo':u ).
hds:ADD-BUFFER( ht:DEFAULT-BUFFER-HANDLE ).
DELETE OBJECT hds. // <-- this cleans up all the dataset's dynamic objects
The temp-table object is deleted by the delete of the dataset.
Confirmed.