sonar-openedge icon indicating copy to clipboard operation
sonar-openedge copied to clipboard

False positive: Dynamic object leak

Open stefandrissen opened this issue 10 months ago • 1 comments

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.

stefandrissen avatar Mar 03 '25 08:03 stefandrissen

Confirmed.

gquerret avatar Mar 06 '25 13:03 gquerret