Skip to content

Commit

Permalink
[NUI] Do not register when we try to copy same handle
Browse files Browse the repository at this point in the history
Since we register to registry by BaseObjectPtr(), it is impossible to
register duplicated handle.

So, actually, we have to deplicate copy BaseHandle constructor.
But for now, just make we don't register into registry now.

Signed-off-by: Eunki, Hong <[email protected]>
  • Loading branch information
Eunki, Hong authored and taehyub committed Oct 30, 2023
1 parent c978622 commit da2a629
Show file tree
Hide file tree
Showing 34 changed files with 184 additions and 122 deletions.
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/Controls/Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ namespace Tizen.NUI.Scene3D
/// <since_tizen> 10 </since_tizen>
public partial class Camera : View
{
internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, true, cRegister)
{
}

Expand All @@ -50,7 +54,7 @@ public Camera() : this(Interop.Camera.New(), true)
/// </summary>
/// <param name="camera">The Camera object to be copied.</param>
/// <since_tizen> 10 </since_tizen>
public Camera(Camera camera) : this(Interop.Camera.NewCamera(Camera.getCPtr(camera)), true)
public Camera(Camera camera) : this(Interop.Camera.NewCamera(Camera.getCPtr(camera)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand Down
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ namespace Tizen.NUI.Scene3D
/// <since_tizen> 10 </since_tizen>
public partial class Model : View
{
internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal Model(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, true, cRegister)
{
}

Expand Down Expand Up @@ -114,7 +118,7 @@ public Model() : this(Interop.Model.ModelNew(), true)
/// </summary>
/// <param name="model">Source object to copy.</param>
/// <since_tizen> 10 </since_tizen>
public Model(Model model) : this(Interop.Model.NewModel(Model.getCPtr(model)), true)
public Model(Model model) : this(Interop.Model.NewModel(Model.getCPtr(model)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
this.PositionUsesPivotPoint = model.PositionUsesPivotPoint;
Expand Down
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public class SceneView : View
private Animation cameraTransition;
private string skyboxUrl;

internal SceneView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal SceneView(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal SceneView(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, true, cRegister)
{
}

Expand All @@ -90,7 +94,7 @@ public SceneView() : this(Interop.SceneView.SceneNew(), true)
/// </summary>
/// <param name="sceneView">The source object.</param>
/// <since_tizen> 10 </since_tizen>
public SceneView(SceneView sceneView) : this(Interop.SceneView.NewScene(SceneView.getCPtr(sceneView)), true)
public SceneView(SceneView sceneView) : this(Interop.SceneView.NewScene(SceneView.getCPtr(sceneView)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand Down
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/Light/Light.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ namespace Tizen.NUI.Scene3D
[EditorBrowsable(EditorBrowsableState.Never)]
public class Light : View
{
internal Light(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal Light(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal Light(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, true, cRegister)
{
}

Expand All @@ -71,7 +75,7 @@ public Light() : this(Interop.Light.New(), true)
/// </summary>
/// <param name="light">Source object to copy.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public Light(Light light) : this(Interop.Light.NewLight(Light.getCPtr(light)), true)
public Light(Light light) : this(Interop.Light.NewLight(Light.getCPtr(light)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand Down
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/ModelComponents/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ namespace Tizen.NUI.Scene3D
[EditorBrowsable(EditorBrowsableState.Never)]
public class Material : BaseHandle
{
internal Material(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal Material(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal Material(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand All @@ -61,7 +65,7 @@ public Material() : this(Interop.Material.MaterialNew(), true)
/// </summary>
/// <param name="material">Source object to copy.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public Material(Material material) : this(Interop.Material.NewMaterial(Material.getCPtr(material)), true)
public Material(Material material) : this(Interop.Material.NewMaterial(Material.getCPtr(material)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand Down
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/ModelComponents/ModelNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ namespace Tizen.NUI.Scene3D
[EditorBrowsable(EditorBrowsableState.Never)]
public class ModelNode : View
{
internal ModelNode(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal ModelNode(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal ModelNode(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, true, cRegister)
{
}

Expand All @@ -66,7 +70,7 @@ public ModelNode() : this(Interop.ModelNode.ModelNodeNew(), true)
/// </summary>
/// <param name="modelNode">Source object to copy.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public ModelNode(ModelNode modelNode) : this(Interop.ModelNode.NewModelNode(ModelNode.getCPtr(modelNode)), true)
public ModelNode(ModelNode modelNode) : this(Interop.ModelNode.NewModelNode(ModelNode.getCPtr(modelNode)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ namespace Tizen.NUI.Scene3D
[EditorBrowsable(EditorBrowsableState.Never)]
public class ModelPrimitive : BaseHandle
{
internal ModelPrimitive(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal ModelPrimitive(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal ModelPrimitive(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand All @@ -60,7 +64,7 @@ public ModelPrimitive() : this(Interop.ModelPrimitive.ModelPrimitiveNew(), true)
/// </summary>
/// <param name="modelPrimitive">Source object to copy.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public ModelPrimitive(ModelPrimitive modelPrimitive) : this(Interop.ModelPrimitive.NewModelPrimitive(ModelPrimitive.getCPtr(modelPrimitive)), true)
public ModelPrimitive(ModelPrimitive modelPrimitive) : this(Interop.ModelPrimitive.NewModelPrimitive(ModelPrimitive.getCPtr(modelPrimitive)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand Down
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/ModelMotion/MotionData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public MotionData(int durationMilliseconds) : this(Interop.MotionData.MotionData
/// </summary>
/// <param name="motionData">Source object to copy.</param>
/// <since_tizen> 11 </since_tizen>
public MotionData(MotionData motionData) : this(Interop.MotionData.NewMotionData(MotionData.getCPtr(motionData)), true)
public MotionData(MotionData motionData) : this(Interop.MotionData.NewMotionData(MotionData.getCPtr(motionData)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand All @@ -134,7 +134,11 @@ internal MotionData Assign(MotionData motionData)
return ret;
}

internal MotionData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal MotionData(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal MotionData(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public BlendShapeIndex(string modelNodeName, string blendShapeName) : this(Inter
/// </summary>
/// <param name="blendShapeIndex">Source object to copy.</param>
/// <since_tizen> 11 </since_tizen>
public BlendShapeIndex(BlendShapeIndex blendShapeIndex) : this(Interop.MotionIndex.NewBlendShapeIndex(BlendShapeIndex.getCPtr(blendShapeIndex)), true)
public BlendShapeIndex(BlendShapeIndex blendShapeIndex) : this(Interop.MotionIndex.NewBlendShapeIndex(BlendShapeIndex.getCPtr(blendShapeIndex)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand All @@ -130,7 +130,11 @@ internal BlendShapeIndex Assign(BlendShapeIndex blendShapeIndex)
return ret;
}

internal BlendShapeIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal BlendShapeIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal BlendShapeIndex(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MotionIndex : BaseHandle
/// </summary>
/// <param name="motionIndex">Source object to copy.</param>
/// <since_tizen> 11 </since_tizen>
public MotionIndex(MotionIndex motionIndex) : this(Interop.MotionIndex.NewMotionIndex(MotionIndex.getCPtr(motionIndex)), true)
public MotionIndex(MotionIndex motionIndex) : this(Interop.MotionIndex.NewMotionIndex(MotionIndex.getCPtr(motionIndex)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand All @@ -66,7 +66,11 @@ internal MotionIndex Assign(MotionIndex motionIndex)
return ret;
}

internal MotionIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal MotionIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal MotionIndex(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public MotionPropertyIndex(string modelNodeName, string propertyName) : this(Int
/// </summary>
/// <param name="motionPropertyIndex">Source object to copy.</param>
/// <since_tizen> 11 </since_tizen>
public MotionPropertyIndex(MotionPropertyIndex motionPropertyIndex) : this(Interop.MotionIndex.NewMotionPropertyIndex(MotionPropertyIndex.getCPtr(motionPropertyIndex)), true)
public MotionPropertyIndex(MotionPropertyIndex motionPropertyIndex) : this(Interop.MotionIndex.NewMotionPropertyIndex(MotionPropertyIndex.getCPtr(motionPropertyIndex)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand All @@ -98,7 +98,11 @@ internal MotionPropertyIndex Assign(MotionPropertyIndex motionPropertyIndex)
return ret;
}

internal MotionPropertyIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal MotionPropertyIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal MotionPropertyIndex(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public MotionTransformIndex(string modelNodeName, TransformTypes transformType)
/// </summary>
/// <param name="motionTransformIndex">Source object to copy.</param>
/// <since_tizen> 11 </since_tizen>
public MotionTransformIndex(MotionTransformIndex motionTransformIndex) : this(Interop.MotionIndex.NewMotionTransformIndex(MotionTransformIndex.getCPtr(motionTransformIndex)), true)
public MotionTransformIndex(MotionTransformIndex motionTransformIndex) : this(Interop.MotionIndex.NewMotionTransformIndex(MotionTransformIndex.getCPtr(motionTransformIndex)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand All @@ -163,7 +163,11 @@ internal MotionTransformIndex Assign(MotionTransformIndex motionTransformIndex)
return ret;
}

internal MotionTransformIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal MotionTransformIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal MotionTransformIndex(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand Down
8 changes: 6 additions & 2 deletions src/Tizen.NUI.Scene3D/src/public/ModelMotion/MotionValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public MotionValue(KeyFrames keyFrames) : this(Interop.MotionValue.MotionValueNe
/// </summary>
/// <param name="motionValue">Source object to copy.</param>
/// <since_tizen> 11 </since_tizen>
public MotionValue(MotionValue motionValue) : this(Interop.MotionValue.NewMotionValue(MotionValue.getCPtr(motionValue)), true)
public MotionValue(MotionValue motionValue) : this(Interop.MotionValue.NewMotionValue(MotionValue.getCPtr(motionValue)), true, false)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand All @@ -111,7 +111,11 @@ internal MotionValue Assign(MotionValue motionValue)
return ret;
}

internal MotionValue(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal MotionValue(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
{
}

internal MotionValue(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}

Expand Down
Loading

0 comments on commit da2a629

Please sign in to comment.