Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit 4f2ea7c

Browse files
author
guanghuispark
committed
update gif fix files
1 parent d904d23 commit 4f2ea7c

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

com.unity.uiwidgets/Runtime/rendering/layer.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public abstract class Layer : AbstractNodeMixinDiagnosticableTree {
5959
get { return (ContainerLayer) base.parent; }
6060
}
6161

62-
public virtual void DisposeCPter()
62+
public virtual void DisposeCPtr()
6363
{
6464
if(_engineLayer != null) {
6565
_engineLayer.DisposeCPtr();
@@ -102,7 +102,7 @@ bool debugSubtreeNeedsAddToScene {
102102
}
103103
}
104104

105-
public EngineLayer engineLayer {
105+
protected EngineLayer engineLayer {
106106
get { return _engineLayer; }
107107
set {
108108
if(_engineLayer != null){
@@ -254,9 +254,9 @@ public PictureLayer(Rect canvasBounds) {
254254
this.canvasBounds = canvasBounds;
255255
}
256256

257-
public override void DisposeCPter()
257+
public override void DisposeCPtr()
258258
{
259-
base.DisposeCPter();
259+
base.DisposeCPtr();
260260
if(_picture != null){
261261
_picture.DisposeCPtr();
262262
}
@@ -504,16 +504,12 @@ protected List<PictureLayer> _debugCheckElevations() {
504504
return addedLayers;
505505
}
506506

507-
public override void DisposeCPter() {
508-
base.DisposeCPter();
509-
DisposeAllChildren();
510-
}
511-
512-
private void DisposeAllChildren(){
507+
public override void DisposeCPtr() {
508+
base.DisposeCPtr();
513509
Layer child = firstChild;
514510
while (child != null) {
515511
Layer next = child.nextSibling;
516-
child.DisposeCPter();
512+
child.DisposeCPtr();
517513
child = next;
518514
}
519515
}
@@ -633,7 +629,7 @@ internal void _removeChild(Layer child) {
633629
child._nextSibling = null;
634630
child._previousSibling = null;
635631
dropChild(child);
636-
child.DisposeCPter();
632+
child.DisposeCPtr();
637633
D.assert(!child.attached);
638634
}
639635

@@ -645,7 +641,7 @@ public void removeAllChildren() {
645641
child._nextSibling = null;
646642
D.assert(child.attached == attached);
647643
dropChild(child);
648-
child.DisposeCPter();
644+
child.DisposeCPtr();
649645
child = next;
650646
}
651647

com.unity.uiwidgets/Runtime/rendering/view.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ public void compositeFrame() {
133133
var builder = new SceneBuilder();
134134
using (var scene = layer.buildScene(builder)) {
135135
Window.instance.render(scene);
136-
builder.DisposeCPtr();
137136
}
138-
137+
builder.DisposeCPtr();
139138
D.assert(() => {
140139
if (D.debugRepaintRainbowEnabled || D.debugRepaintTextRainbowEnabled) {
141140
D.debugCurrentRepaintColor =

com.unity.uiwidgets/Runtime/ui/native_bindings.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,14 @@ public void Dispose() {
6464
_dispose();
6565
}
6666
}
67+
68+
public abstract class NativeWrapperCPtrDisposable : NativeWrapperDisposable {
69+
public bool isDisposed = false;
70+
71+
protected NativeWrapperCPtrDisposable() {
72+
}
73+
74+
protected NativeWrapperCPtrDisposable(IntPtr ptr) : base(ptr) {
75+
}
76+
}
6777
}

com.unity.uiwidgets/Runtime/ui/painting.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,7 @@ internal _ImageInfo(int width, int height, int format, int? rowBytes = null) {
763763
public int rowBytes;
764764
}
765765

766-
public class Image : NativeWrapperDisposable, IEquatable<Image> {
767-
768-
private bool isDisposed = false;
766+
public class Image : NativeWrapperCPtrDisposable, IEquatable<Image> {
769767

770768
internal Image(IntPtr ptr) : base(ptr) {
771769
}
@@ -895,8 +893,7 @@ public override int GetHashCode() {
895893

896894
public delegate void ImageDecoderCallback(Image result);
897895

898-
public class FrameInfo : NativeWrapper {
899-
bool isDisposed = false;
896+
public class FrameInfo : NativeWrapperCPtrDisposable {
900897

901898
internal FrameInfo(IntPtr ptr) : base(ptr) {
902899
}
@@ -1097,8 +1094,7 @@ public enum PathOperation {
10971094
reverseDifference,
10981095
}
10991096

1100-
public abstract class EngineLayer : NativeWrapper {
1101-
private bool isDisposed = false;
1097+
public abstract class EngineLayer : NativeWrapperCPtrDisposable {
11021098
protected EngineLayer(IntPtr ptr) : base(ptr) {
11031099
}
11041100

@@ -2900,9 +2896,8 @@ static extern void Canvas_drawShadow(IntPtr ptr, IntPtr path, uint color, float
29002896
bool transparentOccluder);
29012897
}
29022898

2903-
public class Picture : NativeWrapperDisposable {
2899+
public class Picture : NativeWrapperCPtrDisposable {
29042900

2905-
private bool isDisposed = false;
29062901
internal Picture(IntPtr ptr) : base(ptr) {
29072902
}
29082903

com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,7 @@ Rect targetRect
24442444
}
24452445

24462446

2447-
public override void DisposeCPter() {
2447+
public override void DisposeCPtr() {
24482448
if(_picture != null){
24492449
_picture.DisposeCPtr();
24502450
}

0 commit comments

Comments
 (0)