Skip to content

Commit 43617f8

Browse files
committed
Assert that mutex is not locked during deallocation
1 parent 26760f1 commit 43617f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_bz2module.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ static void
367367
BZ2Compressor_dealloc(PyObject *op)
368368
{
369369
BZ2Compressor *self = _BZ2Compressor_CAST(op);
370+
assert(!PyMutex_IsLocked(&self->mutex));
370371
BZ2_bzCompressEnd(&self->bzs);
371372
PyTypeObject *tp = Py_TYPE(self);
372373
tp->tp_free((PyObject *)self);
@@ -654,6 +655,7 @@ static void
654655
BZ2Decompressor_dealloc(PyObject *op)
655656
{
656657
BZ2Decompressor *self = _BZ2Decompressor_CAST(op);
658+
assert(!PyMutex_IsLocked(&self->mutex));
657659

658660
if(self->input_buffer != NULL) {
659661
PyMem_Free(self->input_buffer);

0 commit comments

Comments
 (0)