Since we always try to register to Registry for Gradient case,
there can make some error for Shape use case.
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Linq;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Linq;
+using System.Runtime.InteropServices;
namespace Tizen.NUI.BaseComponents.VectorGraphics
{
namespace Tizen.NUI.BaseComponents.VectorGraphics
{
get
{
global::System.IntPtr cPtr = Interop.Shape.GetFillGradient(BaseHandle.getCPtr(this));
get
{
global::System.IntPtr cPtr = Interop.Shape.GetFillGradient(BaseHandle.getCPtr(this));
- Gradient ret = new Gradient(cPtr, true);
+
+ Gradient ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Gradient;
+ if (ret != null)
+ {
+ HandleRef CPtr = new HandleRef(this, cPtr);
+ Interop.BaseHandle.DeleteBaseHandle(CPtr);
+ CPtr = new HandleRef(null, global::System.IntPtr.Zero);
+ }
+ else
+ {
+ ret = new Gradient(cPtr, true);
+ }
get
{
global::System.IntPtr cPtr = Interop.Shape.GetStrokeGradient(BaseHandle.getCPtr(this));
get
{
global::System.IntPtr cPtr = Interop.Shape.GetStrokeGradient(BaseHandle.getCPtr(this));
- Gradient ret = new Gradient(cPtr, true);
+
+ Gradient ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Gradient;
+ if (ret != null)
+ {
+ HandleRef CPtr = new HandleRef(this, cPtr);
+ Interop.BaseHandle.DeleteBaseHandle(CPtr);
+ CPtr = new HandleRef(null, global::System.IntPtr.Zero);
+ }
+ else
+ {
+ ret = new Gradient(cPtr, true);
+ }