From 8f01c5394dcce8f5d4e7102dacfcdea9d1f7b021 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 16 Jul 2009 01:16:09 +0000 Subject: Add destructor callbacks for polymorphic C types, and use their base dmnsn_delete_*() function. --- libdimensionxx/object.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libdimensionxx/object.cpp') diff --git a/libdimensionxx/object.cpp b/libdimensionxx/object.cpp index e5384db..9c28e22 100644 --- a/libdimensionxx/object.cpp +++ b/libdimensionxx/object.cpp @@ -22,9 +22,13 @@ namespace Dimension { - // Virtual no-op destructor + // Virtual destructor Object::~Object() - { } + { + if (unique()) { + dmnsn_delete_object(dmnsn()); + } + } // Get the transformation matrix Matrix -- cgit v1.2.3