From 13e14768dafb1a180aad94e856103fafac510054 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 19 Sep 2013 12:33:57 -0500 Subject: [PATCH] binpac: Add virtual dtor to RefCount base class. The code generated for types w/ &refcount will subclass RefCount and Unref definitely deletes via a pointer to that base class so it needs a virtual dtor. --- tools/binpac/lib/binpac.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/binpac/lib/binpac.h.in b/tools/binpac/lib/binpac.h.in index 8d7c137d7b..f5c6e152c7 100644 --- a/tools/binpac/lib/binpac.h.in +++ b/tools/binpac/lib/binpac.h.in @@ -150,6 +150,7 @@ class RefCount { public: RefCount() { count = 1; } + virtual ~RefCount() {} void Ref() { ++count; } int Unref() { BINPAC_ASSERT(count > 0); return --count; }