From e059d55d29f3a4e99378ec7e857202f1345a92a5 Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Fri, 27 Jan 2023 01:50:57 -0800 Subject: [PATCH] Correctly check refCount in finalize. PiperOrigin-RevId: 505057866 --- .../java/com/google/mediapipe/framework/GraphTextureFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediapipe/java/com/google/mediapipe/framework/GraphTextureFrame.java b/mediapipe/java/com/google/mediapipe/framework/GraphTextureFrame.java index 63ea7854b..6a2c97b94 100644 --- a/mediapipe/java/com/google/mediapipe/framework/GraphTextureFrame.java +++ b/mediapipe/java/com/google/mediapipe/framework/GraphTextureFrame.java @@ -158,7 +158,7 @@ public class GraphTextureFrame implements TextureFrame { @Override protected void finalize() throws Throwable { - if (refCount >= 0 || nativeBufferHandle != 0) { + if (refCount > 0 || nativeBufferHandle != 0) { logger.atWarning().log("release was not called before finalize"); } if (!activeConsumerContextHandleSet.isEmpty()) {