I don´t understand the next paragraph (help SAP Library)
Is there a error? CREF1 to
CREF3
?CREF1 to CREF2
. As a result, the reference in CREF3 also points to the object C_COUNTER<1>. No more references point to the object C_COUNTER<2>, and it is automatically deleted by the garbage collection. The internal name C_COUNTER<2> is now free again."Hello Lopez
To clarify the question I have pasted the coding here:
DATA: cref1 TYPE REF TO c_counter, cref2 TYPE REF TO c_counter, cref3 LIKE CREF1. CREATE OBJECT: cref1, cref2. " 'pointers' for both instances exist MOVE cref2 TO cref3. " cref2 and cref3 point to the same instance CLEAR cref2. " cref3 still filled -> still pointers to both instances exist cref3 = cref1. " cref3 points no longer to instance<2> but instance<1> " Thus, there is no pointer to instance<2> anymore " instance<2> will be removed by garbage collector
Regards
Uwe
Add a comment