Commit fd3c2c7b authored by Romain Vimont's avatar Romain Vimont Committed by Geoffrey Métais

Assert refcount == 0 on finalize

VLCObject manages a refcount to release native resources. If the Java
object is finalized, this is an error if the refcount is not 0
(native resources have not been released as expected).
Signed-off-by: default avatarGeoffrey Métais <>
(cherry picked from commit afea771c)
parent bd276180
......@@ -91,6 +91,12 @@ abstract class VLCObject<T extends VLCEvent> {
protected synchronized void finalize() {
if (!isReleased())
throw new AssertionError("VLCObject (" + getClass().getName() + ") finalized but not natively released (" + mNativeRefCount + " refs)");
* Set an event listener.
* Events are sent via the android main thread.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment