From 02352c78b82d16b78243a3ccc04638df54ae40ee Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 8 Oct 2016 17:55:40 -0400 Subject: [PATCH] Fix ref::~ref to not try to RemoveRef if already deleted. Caught by TestReset. --- zcpointer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zcpointer.h b/zcpointer.h index 06ce70c..3155051 100644 --- a/zcpointer.h +++ b/zcpointer.h @@ -99,8 +99,10 @@ class ref { } ~ref() { - ptr_->get_deleter().RemoveRef(this); - MarkDeleted(); + if (!IsDeleted()) { + ptr_->get_deleter().RemoveRef(this); + MarkDeleted(); + } } T* operator->() const { -- 2.43.5