diff mbox series

[FFmpeg-devel,v4,4/6] avcodec/jni: remove unnecessary NULL checks before calling DeleteLocalRef()

Message ID 20240317223102.49414-5-matthieu.bouron@gmail.com
State New
Headers show
Series [FFmpeg-devel,v4,1/6] avcodec: add av_jni_{get, set}_android_app_ctx helper | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Matthieu Bouron March 17, 2024, 10:28 p.m. UTC
Delete{Global,Local}Ref() already handle NULL.
---
 libavcodec/ffjni.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/ffjni.c b/libavcodec/ffjni.c
index e3cf24d3e2..69d9a9faa3 100644
--- a/libavcodec/ffjni.c
+++ b/libavcodec/ffjni.c
@@ -236,17 +236,9 @@  done:
     av_free(name);
     av_free(message);
 
-    if (class_class) {
-        (*env)->DeleteLocalRef(env, class_class);
-    }
-
-    if (exception_class) {
-        (*env)->DeleteLocalRef(env, exception_class);
-    }
-
-    if (string) {
-        (*env)->DeleteLocalRef(env, string);
-    }
+    (*env)->DeleteLocalRef(env, class_class);
+    (*env)->DeleteLocalRef(env, exception_class);
+    (*env)->DeleteLocalRef(env, string);
 
     return ret;
 }