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

Commit bedfd8a

Browse files
author
guanghuispark
committed
add notes for class NativeWrapperCPtrDisposable
1 parent 8eeddaa commit bedfd8a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ public void Dispose() {
6565
}
6666
}
6767

68+
/// <summary>
69+
/// This class is used to release c++ resources in advance without waiting for c# garbage collection.
70+
/// Please make sure that the resource will not be used again after it is released.
71+
/// Releasing resources prematurely may cause null pointer exceptions in references elsewhere.
72+
///
73+
/// Usage:
74+
/// Use DisposeCPtr() to manually release c++ resources, and then add an interface to release unmanaged memory
75+
/// in DisposeCPtrImpl(IntPtr ptr).
76+
/// </summary>
6877
public abstract class NativeWrapperCPtrDisposable : NativeWrapperDisposable {
6978
public bool isDisposed = false;
7079

0 commit comments

Comments
 (0)