Skip to content
Browse files

Fix refcount error in copy function of memoryviews

  • Loading branch information...
1 parent c68e59a commit 3d5bc03f1e7f4e3f34cec3131fe5cb0d0a177a18 @markflorisson markflorisson committed May 1, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 Cython/Utility/MemoryView_C.c
View
8 Cython/Utility/MemoryView_C.c
@@ -493,6 +493,7 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
goto fail;
} else {
PyTuple_SET_ITEM(shape_tuple, i, temp_int);
+ temp_int = NULL;
}
}
@@ -524,10 +525,9 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
new_mvs.memview = NULL;
new_mvs.data = NULL;
no_fail:
- __Pyx_XDECREF(shape_tuple); shape_tuple = 0;
- __Pyx_GOTREF(temp_int);
- __Pyx_XDECREF(temp_int); temp_int = 0;
- __Pyx_XDECREF(array_obj); array_obj = 0;
+ __Pyx_XDECREF(shape_tuple);
+ __Pyx_XDECREF(temp_int);
+ __Pyx_XDECREF(array_obj);
__Pyx_RefNannyFinishContext();
return new_mvs;
}

0 comments on commit 3d5bc03

Please sign in to comment.
Something went wrong with that request. Please try again.