[NUI][API10] Fix dispose timing error for ImageUrl
authorEunki Hong <eunkiki.hong@samsung.com>
Sun, 29 Jan 2023 08:14:03 +0000 (17:14 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Mon, 30 Jan 2023 02:01:24 +0000 (11:01 +0900)
Since we update ImageView lazy, ImageUrl's lifecycle might not matched
what user think.

```
ImageUrl imageUrl = ~~~.GenerateUrl();
ImageView imageView = new ImageView(imageUrl.ToString());
imageUrl.Dispose(); ///< We should allow this situation.
```

To make scene, We allow to call UpdateImage(); synchoronously
if we use GeneratedUrl().

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

index 85e3d97..c410a29 100755 (executable)
@@ -1297,6 +1297,11 @@ namespace Tizen.NUI.BaseComponents
                     {
                         UpdateImage(ImageVisualProperty.URL, setValue);
                     }
+                    // Special case. If we set GeneratedUrl, Create ImageVisual synchronously.
+                    if(value.StartsWith("dali://") || value.StartsWith("enbuf://"))
+                    {
+                        UpdateImage();
+                    }
                 }
             }
         }