[Tizen] fix crash: HasBody() null reference
authordongsug.song <dongsug.song@samsung.com>
Mon, 24 Jul 2017 11:35:49 +0000 (20:35 +0900)
committerdongsug song <dongsug.song@samsung.com>
Mon, 24 Jul 2017 11:37:09 +0000 (11:37 +0000)
- 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 <dongsug.song@samsung.com>
src/Tizen.NUI/src/public/BaseHandle.cs

index e0d7ecc..130d455 100755 (executable)
@@ -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;