diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 4f189c5..826feb7 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4236,7 +4236,9 @@ void vrend_renderer_resource_destroy(struct vrend_resource *res, bool remove) static void vrend_destroy_resource_object(void *obj_ptr) { struct vrend_resource *res = obj_ptr; - vrend_renderer_resource_destroy(res, false); + + if (pipe_reference(&res->base.reference, NULL)) + vrend_renderer_resource_destroy(res, false); } void vrend_renderer_resource_unref(uint32_t res_handle)