Skip to content

Commit 766ee27

Browse files
authored
Merge pull request numpy#26419 from ngoldbaum/clean-up-array-owned
MNT: clean up references to array_owned==2 case in StringDType
2 parents 1c9504f + bc15ac9 commit 766ee27

File tree

1 file changed

+2
-3
lines changed
  • numpy/_core/src/multiarray/stringdtype

1 file changed

+2
-3
lines changed

numpy/_core/src/multiarray/stringdtype/dtype.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ new_stringdtype_instance(PyObject *na_object, int coerce)
3333

3434
char *default_string_buf = NULL;
3535
char *na_name_buf = NULL;
36-
char array_owned = 0;
3736

3837
npy_string_allocator *allocator = NpyString_new_allocator(PyMem_RawMalloc, PyMem_RawFree,
3938
PyMem_RawRealloc);
@@ -138,7 +137,7 @@ new_stringdtype_instance(PyObject *na_object, int coerce)
138137
if (na_name_buf != NULL) {
139138
PyMem_RawFree(na_name_buf);
140139
}
141-
if (allocator != NULL && array_owned != 2) {
140+
if (allocator != NULL) {
142141
NpyString_free_allocator(allocator);
143142
}
144143
return NULL;
@@ -660,7 +659,7 @@ stringdtype_dealloc(PyArray_StringDTypeObject *self)
660659
{
661660
Py_XDECREF(self->na_object);
662661
// 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) {
664663
NpyString_free_allocator(self->allocator);
665664
}
666665
PyMem_RawFree((char *)self->na_name.buf);

0 commit comments

Comments
 (0)