[FFmpeg-cvslog] avcodec/jni: remove unnecessary NULL checks before calling DeleteLocalRef()
Matthieu Bouron
git at videolan.org
Sat Mar 23 12:40:02 EET 2024
ffmpeg | branch: master | Matthieu Bouron <matthieu.bouron at gmail.com> | Tue Feb 13 11:05:45 2024 +0100| [dab4124350a0f2838e7105043abc1f7d3ccb5b0a] | committer: Matthieu Bouron
avcodec/jni: remove unnecessary NULL checks before calling DeleteLocalRef()
Delete{Global,Local}Ref() already handle NULL.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dab4124350a0f2838e7105043abc1f7d3ccb5b0a
---
libavcodec/ffjni.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
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;
}
More information about the ffmpeg-cvslog
mailing list