Copilot commented on code in PR #1533:
URL: https://github.com/apache/cloudberry/pull/1533#discussion_r2695701955


##########
src/backend/gporca/libgpopt/src/base/CWindowOids.cpp:
##########
@@ -18,6 +18,13 @@ CWindowOids::CWindowOids(CMemoryPool *mp, OID 
row_number_oid, OID rank_oid,
        m_MDDenseRank = GPOS_NEW(mp) CMDIdGPDB(IMDId::EmdidGeneral, 
m_oidDenseRank);
 }
 
+CWindowOids::~CWindowOids()
+{
+       m_MDIdRowNumber->Release();
+       m_MDIdRank->Release();
+       m_MDDenseRank->Release();

Review Comment:
   Consider using `CRefCount::SafeRelease()` instead of direct `Release()` 
calls for consistency with other classes in the codebase (e.g., 
`CWindowFrame`). While the direct calls are functionally correct since these 
pointers are always initialized in the constructor, `SafeRelease()` provides 
better defensive programming and is more consistent with the ORCA codebase 
patterns.
   ```suggestion
        CRefCount::SafeRelease(m_MDIdRowNumber);
        CRefCount::SafeRelease(m_MDIdRank);
        CRefCount::SafeRelease(m_MDDenseRank);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to