File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 33///
44/// # Safety
55/// If the reference count is decremented to zero, the object is freed and `objPtr` turns into a null pointer.
6+ /// If objPtr is null, UB occurs.
67pub unsafe fn Tcl_DecrRefCount ( objPtr : * mut Tcl_Obj ) {
78 let mut obj = unsafe { * objPtr } ;
89 obj. refCount -= 1 ;
910 if obj. refCount == 0 {
1011 // Free the object
11- unsafe { Tcl_Free ( objPtr as * mut std :: ffi :: c_char ) } ;
12+ unsafe { Tcl_Free ( objPtr as _ ) } ;
1213 }
1314}
1415
@@ -17,6 +18,7 @@ pub unsafe fn Tcl_DecrRefCount(objPtr: *mut Tcl_Obj) {
1718///
1819/// # Safety
1920/// If [`Tcl_DecrRefCount`] is not called and the pointer is dropped, the object will be leaked.
21+ /// If objPtr is null, UB occurs.
2022pub unsafe fn Tcl_IncrRefCount ( objPtr : * mut Tcl_Obj ) {
2123 let mut obj = unsafe { * objPtr } ;
2224 obj. refCount += 1 ;
You can’t perform that action at this time.
0 commit comments