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
Fields -
Constructor Summary
Constructors -
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:RefCountedIncreases ref count by one.- Specified by:
retainin interfaceRefCounted
-
release
public void release()Description copied from interface:RefCountedDecreases ref count by one. When the ref count reaches zero, resources related to the object will be freed.- Specified by:
releasein 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.
-