Skip to content

Commit a8bc75e

Browse files
committed
Releas source buffer
1 parent cd5fcaf commit a8bc75e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpctl/_sycl_queue.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ cdef DPCTLSyclEventRef _memcpy_impl(
372372
elif _is_buffer(dst):
373373
ret_code = PyObject_GetBuffer(dst, &dst_buf_view, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS | PyBUF_WRITABLE)
374374
if ret_code != 0: # pragma: no cover
375+
if src_is_buf:
376+
PyBuffer_Release(&src_buf_view)
375377
raise RuntimeError("Could not access buffer")
376378
c_dst_ptr = dst_buf_view.buf
377379
dst_is_buf = True

0 commit comments

Comments
 (0)