[NUI] Exception if someone change disposed ImageView's property
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 26 Jun 2023 05:14:10 +0000 (14:14 +0900)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Wed, 28 Jun 2023 06:29:15 +0000 (15:29 +0900)
Since we don't check validation of ImageView itself during change
ImageView properties, it will not throw any exceptions.
and it will be crashend when we ProcessOnceEvent invoked.

Normal View property directly access to DALi side. But ImageView
property access to DALi side lazy.

Now this throw make app developer easy to find error codes.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs

index ef696fe..fda30cf 100755 (executable)
@@ -1462,6 +1462,12 @@ namespace Tizen.NUI.BaseComponents
             // Update image property map value as inputed value.
             if (key != 0)
             {
+                if(!HasBody())
+                {
+                    // Throw exception if ImageView is disposed.
+                    throw new global::System.InvalidOperationException("[NUI][ImageVIew] Someone try to change disposed ImageView's property.\n");
+                }
+
                 if (cachedImagePropertyMap == null)
                 {
                     cachedImagePropertyMap = new PropertyMap();