From f682afc33b4ff06835c597d63227a5e61de9fbfa Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Fri, 21 Oct 2005 14:17:46 +0000 Subject: [PATCH] Bugfix: [ 541846 ] SmartPtr and COMRefCounted git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@317 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/SmartPtr.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/loki/SmartPtr.h b/include/loki/SmartPtr.h index 67acec3..efc0ddc 100644 --- a/include/loki/SmartPtr.h +++ b/include/loki/SmartPtr.h @@ -234,12 +234,17 @@ namespace Loki static P Clone(const P& val) { - val->AddRef(); + if(val!=0) + val->AddRef(); return val; } static bool Release(const P& val) - { val->Release(); return false; } + { + if(val!=0) + val->Release(); + return false; + } enum { destructiveCopy = false };