11# ------------------------------------------------------------------------------
2- # Copyright (c) 2020, 2022 , Oracle and/or its affiliates.
2+ # Copyright (c) 2020, 2023 , Oracle and/or its affiliates.
33#
44# This software is dual-licensed to you under the Universal Permissive License
55# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -114,8 +114,12 @@ cdef class ThickDbObjectImpl(BaseDbObjectImpl):
114114 if data.isNull:
115115 return None
116116 type_impl = self .type
117- return _convert_to_python(type_impl._conn_impl, attr.dbtype,
118- attr.objtype, & data.value)
117+ try :
118+ return _convert_to_python(type_impl._conn_impl, attr.dbtype,
119+ attr.objtype, & data.value)
120+ finally :
121+ if attr.objtype is not None :
122+ dpiObject_release(data.value.asObject)
119123
120124 def get_element_by_index (self , int32_t index ):
121125 """
@@ -138,8 +142,13 @@ cdef class ThickDbObjectImpl(BaseDbObjectImpl):
138142 _raise_from_odpi()
139143 if data.isNull:
140144 return None
141- return _convert_to_python(objtype._conn_impl, objtype.element_dbtype,
142- objtype.element_objtype, & data.value)
145+ try :
146+ return _convert_to_python(objtype._conn_impl,
147+ objtype.element_dbtype,
148+ objtype.element_objtype, & data.value)
149+ finally :
150+ if objtype.element_objtype is not None :
151+ dpiObject_release(data.value.asObject)
143152
144153 def get_first_index (self ):
145154 """
0 commit comments