From b08bacd8d3ceea3d5ab4c4675c614ae769a4d243 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Mon, 24 Jul 2017 20:35:49 +0900 Subject: [PATCH] [Tizen] fix crash: HasBody() null reference - when object is disposed but not set as null in C# side, native object of HasBody() gives null reference exception Change-Id: I0b99d583de4262bf95b06acbbfe2df2e2b742324 Signed-off-by: dongsug.song --- src/Tizen.NUI/src/public/BaseHandle.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index e0d7ecc..130d455 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -307,6 +307,11 @@ namespace Tizen.NUI public bool HasBody() { + if (disposed == true) + { + return false; + } + bool ret = NDalicPINVOKE.BaseHandle_HasBody(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -314,6 +319,11 @@ namespace Tizen.NUI public bool IsEqual(BaseHandle rhs) { + if (disposed == true) + { + return false; + } + bool ret = NDalicPINVOKE.BaseHandle_IsEqual(swigCPtr, BaseHandle.getCPtr(rhs)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; -- 2.7.4