summaryrefslogtreecommitdiffstats
path: root/src/common/util/CountedPtr.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-15 07:40:28 +0000
committerDavid Robillard <d@drobilla.net>2006-06-15 07:40:28 +0000
commit94c0fff479da5e81dede855cf5c382cf23aadf7d (patch)
tree9d39434ee8d5aaf921cfa239f5d294f5982145b0 /src/common/util/CountedPtr.h
parent531bde92d57b6eb014390b7051a9353a445fcc6a (diff)
downloadingen-94c0fff479da5e81dede855cf5c382cf23aadf7d.tar.gz
ingen-94c0fff479da5e81dede855cf5c382cf23aadf7d.tar.bz2
ingen-94c0fff479da5e81dede855cf5c382cf23aadf7d.zip
Subpatches working
git-svn-id: http://svn.drobilla.net/lad/grauph@39 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/common/util/CountedPtr.h')
-rw-r--r--src/common/util/CountedPtr.h13
1 files changed, 7 insertions, 6 deletions
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<T* const>(y._counter->ptr);
+ T* const casted_y = dynamic_cast<T* const>(y._counter->ptr);
#else
- T* const unused_variable = static_cast<T* const>(y._counter->ptr);
+ T* const casted_y = static_cast<T* const>(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. */