From dfb29b258bb1e406853f3dbe4f046ae1af852d6a Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 31 Aug 2009 23:21:37 +0000 Subject: [PATCH] added warning comment about need to unref newly created gdd before installing into smart pointer --- src/gdd/smartGDDPointer.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gdd/smartGDDPointer.h b/src/gdd/smartGDDPointer.h index 2e14a6bb8..ca835d503 100644 --- a/src/gdd/smartGDDPointer.h +++ b/src/gdd/smartGDDPointer.h @@ -20,6 +20,21 @@ #include "gdd.h" #include "shareLib.h" +// +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// !! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !! +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// // be careful to manually unreference here +// // (the reference count is initialized to one by the gdd ctor) +// Gdd * pDD0 = new gdd; +// smartGDDPointer pDD1 (pDD0); +// pDD0->unreference (); +// +// // from here on down the smart pointer maintains the ref count +// smartGDDPointer pDD2 = pDD1; +// smartGDDPointer pDD3 = pDD2; +// pDD2 = pDD3; +// template < class T > class smartGDDPointerTemplate { public: