From 5c3390215e6abb1c573e48d7a43571cda84c1e8d 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 --- 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 2c67a35f941c..c237fb18ee3a 100644 --- a/src/runtime/HalideBuffer.h +++ b/src/runtime/HalideBuffer.h @@ -995,8 +995,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. */