File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -305,8 +305,8 @@ PyArray_RegisterDataType(PyArray_Descr *descr)
305305 NPY_DT_SLOTS (NPY_DTYPE (descr ))-> get_clear_loop = (
306306 & npy_get_clear_void_and_legacy_user_dtype_loop );
307307 /* Also use the void zerofill since there may be objects */
308- NPY_DT_SLOTS (NPY_DTYPE (descr ))-> get_clear_loop = (
309- & npy_get_zerofill_void_and_legacy_user_dtype_loop );
308+ NPY_DT_SLOTS (NPY_DTYPE (descr ))-> get_fill_zero_loop = (
309+ ( get_traverse_loop_function * ) & npy_get_zerofill_void_and_legacy_user_dtype_loop );
310310 }
311311
312312 return typenum ;
Original file line number Diff line number Diff line change @@ -1848,6 +1848,13 @@ class mytype:
18481848 # unnecessary restriction, but one that has been around forever:
18491849 assert np .dtype (mytype ) == np .dtype ("O" )
18501850
1851+ if HAS_REFCOUNT :
1852+ # Create an array and test that memory gets cleaned up (gh-25949)
1853+ o = object ()
1854+ a = np .array ([o ], dtype = dt )
1855+ del a
1856+ assert sys .getrefcount (o ) == 2
1857+
18511858 def test_custom_structured_dtype_errors (self ):
18521859 class mytype :
18531860 pass
You can’t perform that action at this time.
0 commit comments