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/camera.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libdimensionxx/camera.cpp') diff --git a/libdimensionxx/camera.cpp b/libdimensionxx/camera.cpp index b44173c..5786055 100644 --- a/libdimensionxx/camera.cpp +++ b/libdimensionxx/camera.cpp @@ -22,9 +22,13 @@ namespace Dimension { - // Virtual no-op destructor + // Virtual destructor Camera::~Camera() - { } + { + if (unique()) { + dmnsn_delete_camera(dmnsn()); + } + } // Return the result of the dmnsn_camera*'s ray callback Line -- cgit v1.2.3