Skip to content

Commit

Permalink
Add virtual dtor to RefCount base class.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jsiwek committed Sep 19, 2013
1 parent 75e6906 commit b226a66
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/binpac.h.in
Expand Up @@ -150,6 +150,7 @@ class RefCount
{
public:
RefCount() { count = 1; }
virtual ~RefCount() {}
void Ref() { ++count; }
int Unref() { BINPAC_ASSERT(count > 0); return --count; }

Expand Down

0 comments on commit b226a66

Please sign in to comment.