From 94c0fff479da5e81dede855cf5c382cf23aadf7d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 15 Jun 2006 07:40:28 +0000 Subject: Subpatches working git-svn-id: http://svn.drobilla.net/lad/grauph@39 a436a847-0d15-0410-975c-d299462d15a1 --- src/common/util/CountedPtr.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/common/util') diff --git a/src/common/util/CountedPtr.h b/src/common/util/CountedPtr.h index 0886bf36..10c724c5 100644 --- a/src/common/util/CountedPtr.h +++ b/src/common/util/CountedPtr.h @@ -86,15 +86,16 @@ public: // Fail if this is not a valid cast if (y) { #ifdef WITH_RTTI - T* const unused_variable = dynamic_cast(y._counter->ptr); + T* const casted_y = dynamic_cast(y._counter->ptr); #else - T* const unused_variable = static_cast(y._counter->ptr); + T* const casted_y = static_cast(y._counter->ptr); #endif - assert(unused_variable == y._counter->ptr); // shuts up gcc + if (casted_y != NULL) { + assert(casted_y == y._counter->ptr); + //release(); // FIXME: leak? + retain((Counter*)y._counter); + } } - - //release(); - retain((Counter*)y._counter); } /** Assign to the value of a CountedPtr of the same type. */ -- cgit v1.2.1