summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c')
-rw-r--r--src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c b/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
index 2694f57bca..a2657dac59 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
+++ b/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
@@ -399,6 +399,8 @@ mm_buffer_destroy(struct pb_buffer *buf)
struct mm_buffer *mm_buf = mm_buffer(buf);
struct mm_pb_manager *mm = mm_buf->mgr;
+ assert(buf->base.refcount == 0);
+
_glthread_LOCK_MUTEX(mm->mutex);
mmFreeMem(mm_buf->block);
FREE(buf);