Package org.webrtc
Class RefCountDelegate
java.lang.Object
org.webrtc.RefCountDelegate
- All Implemented Interfaces:
RefCounted
Implementation of RefCounted that executes a Runnable once the ref count reaches zero.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
refCount
-
releaseCallback
-
-
Constructor Details
-
RefCountDelegate
- Parameters:
releaseCallback
- Callback that will be executed once the ref count reaches zero.
-
-
Method Details
-
retain
public void retain()Description copied from interface:RefCounted
Increases ref count by one.- Specified by:
retain
in interfaceRefCounted
-
release
public void release()Description copied from interface:RefCounted
Decreases ref count by one. When the ref count reaches zero, resources related to the object will be freed.- Specified by:
release
in interfaceRefCounted
-
safeRetain
boolean safeRetain()Tries to retain the object. Can be used in scenarios where it is unknown if the object has already been released. Returns true if successful or false if the object was already released.
-