Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add decrefs in boxing (#836)
  • Loading branch information
1e-to authored May 13, 2020
commit 0b1bb413229c7f404424e4c3daa3ede994cbd7ec
7 changes: 6 additions & 1 deletion sdc/hiframes/boxing.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def box_dataframe(typ, val, c):
# context.nrt.incref(builder, arr_typ, arr)
pyapi.dict_setitem(df_dict, cname_obj, arr_obj)

# pyapi.decref(arr_obj)
pyapi.decref(arr_obj)
pyapi.decref(cname_obj)

df_obj = pyapi.call_method(class_obj, "DataFrame", (df_dict,))
Expand All @@ -250,6 +250,7 @@ def box_dataframe(typ, val, c):
if typ.index != types.none:
arr_obj = _box_series_data(typ.index.dtype, typ.index, dataframe.index, c)
pyapi.object_setattr_string(df_obj, 'index', arr_obj)
pyapi.decref(arr_obj)

pyapi.decref(class_obj)
# pyapi.gil_release(gil_state) # release GIL
Expand Down Expand Up @@ -355,6 +356,10 @@ def box_series(typ, val, c):
res = c.pyapi.call_method(
pd_class_obj, "Series", (arr, index, dtype, name))

c.pyapi.decref(arr)
c.pyapi.decref(index)
c.pyapi.decref(dtype)
c.pyapi.decref(name)
c.pyapi.decref(pd_class_obj)
return res

Expand Down