From: Eunki, Hong Date: Tue, 8 Apr 2025 08:36:11 +0000 (+0900) Subject: (ParticleSystem) Fix crash issue when particle create failed X-Git-Tag: dali_2.4.14~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6dfef09c653469b90d6e6d7e79a1cb7b6e6da11;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git (ParticleSystem) Fix crash issue when particle create failed It is possible that particle handle is empty. In this case, we should not call GetImplement() Change-Id: I709708a231fe4856b026b8085ffd0e76300a0f27 Signed-off-by: Eunki, Hong --- diff --git a/dali-csharp-binder/dali-toolkit/particle-system-wrap.cpp b/dali-csharp-binder/dali-toolkit/particle-system-wrap.cpp index 9c6e9be8..36782dd5 100644 --- a/dali-csharp-binder/dali-toolkit/particle-system-wrap.cpp +++ b/dali-csharp-binder/dali-toolkit/particle-system-wrap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -579,10 +579,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Dali_ParticleEmitter_NewParticle(void* csEmitt try { Particle p = emitter->GetParticleList().NewParticle(lifetime); - return int(p.GetIndex()); + if(p) + { + return p.GetIndex(); + } } CALL_CATCH_EXCEPTION(-1); } + return -1; } SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_ParticleEmitter_GetParticleList(void* csThis)