From 4788b751fb616757033c805ad33062fd7128a42a Mon Sep 17 00:00:00 2001 From: yvt Date: Sun, 24 Nov 2013 00:17:28 +0900 Subject: [PATCH] Fixed a bug that assignment of NULL to Handle caused a crash --- Sources/Core/RefCountedObject.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Core/RefCountedObject.h b/Sources/Core/RefCountedObject.h index 95f12ce2..5b519b1d 100644 --- a/Sources/Core/RefCountedObject.h +++ b/Sources/Core/RefCountedObject.h @@ -76,7 +76,7 @@ namespace spades { } T *old = ptr; ptr = p; - if(add) + if(add && ptr) ptr->AddRef(); if(old) old->Release();