Skip to content

Commit 245f0e3

Browse files
committed
fix clearing errors
1 parent f86e5ce commit 245f0e3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

stringdtype/stringdtype/src/dtype.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@ static void
582582
stringdtype_dealloc(StringDTypeObject *self)
583583
{
584584
Py_XDECREF(self->na_object);
585+
npy_string_free(&self->packed_default_string);
586+
npy_string_free(&self->packed_na_name);
585587
PyArrayDescr_Type.tp_dealloc((PyObject *)self);
586588
}
587589

stringdtype/stringdtype/src/static_string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ npy_string_free(npy_packed_static_string *str)
178178
{
179179
if (is_not_a_vstring(str)) {
180180
// zero out
181-
memcpy(str, &NPY_EMPTY_STRING, sizeof(npy_static_string));
181+
memcpy(str, NPY_EMPTY_STRING, sizeof(npy_packed_static_string));
182182
}
183183
else {
184184
_npy_static_string_u *str_u = (_npy_static_string_u *)str;

0 commit comments

Comments
 (0)