From bd7a3db8385954110eed9ade441085639d96190e Mon Sep 17 00:00:00 2001 From: Andrew Adams Date: Tue, 4 Jan 2022 08:08:43 -0800 Subject: [PATCH] free shape storage last (#6511) Some decref-triggered runtime methods need the shape Fixes #6509 Co-authored-by: Steven Johnson (cherry picked from commit 5c3390215e6abb1c573e48d7a43571cda84c1e8d) --- src/runtime/HalideBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/HalideBuffer.h b/src/runtime/HalideBuffer.h index 86fe6c05c0b4..dfcb5ea235ef 100644 --- a/src/runtime/HalideBuffer.h +++ b/src/runtime/HalideBuffer.h @@ -991,8 +991,8 @@ class Buffer { * this is the last reference to it. Will assert fail if there are * weak references to this Buffer outstanding. */ ~Buffer() { - free_shape_storage(); decref(); + free_shape_storage(); } /** Get a pointer to the raw halide_buffer_t this wraps. */