File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
numpy/_core/src/multiarray/stringdtype Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ new_stringdtype_instance(PyObject *na_object, int coerce)
33
33
34
34
char * default_string_buf = NULL ;
35
35
char * na_name_buf = NULL ;
36
- char array_owned = 0 ;
37
36
38
37
npy_string_allocator * allocator = NpyString_new_allocator (PyMem_RawMalloc , PyMem_RawFree ,
39
38
PyMem_RawRealloc );
@@ -138,7 +137,7 @@ new_stringdtype_instance(PyObject *na_object, int coerce)
138
137
if (na_name_buf != NULL ) {
139
138
PyMem_RawFree (na_name_buf );
140
139
}
141
- if (allocator != NULL && array_owned != 2 ) {
140
+ if (allocator != NULL ) {
142
141
NpyString_free_allocator (allocator );
143
142
}
144
143
return NULL ;
@@ -660,7 +659,7 @@ stringdtype_dealloc(PyArray_StringDTypeObject *self)
660
659
{
661
660
Py_XDECREF (self -> na_object );
662
661
// this can be null if an error happens while initializing an instance
663
- if (self -> allocator != NULL && self -> array_owned != 2 ) {
662
+ if (self -> allocator != NULL ) {
664
663
NpyString_free_allocator (self -> allocator );
665
664
}
666
665
PyMem_RawFree ((char * )self -> na_name .buf );
You can’t perform that action at this time.
0 commit comments