Skip to content

Commit

Permalink
Add macro for deleting local references
Browse files Browse the repository at this point in the history
  • Loading branch information
normanmaurer committed Sep 4, 2023
1 parent eaab6f9 commit c457043
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/c/netty_jni_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@
} \
NETTY_JNI_UTIL_END_MACRO

#define NETTY_JNI_UTIL_DELETE_LOCAL(E, L) \
NETTY_JNI_UTIL_BEGIN_MACRO \
if (L != NULL) { \
(*(E))->DeleteLocalRef((E), L); \
} \
NETTY_JNI_UTIL_END_MACRO

#define NETTY_JNI_UTIL_GET_METHOD(E, C, M, N, S, R) \
NETTY_JNI_UTIL_BEGIN_MACRO \
M = (*(E))->GetMethodID((E), C, N, S); \
Expand Down

0 comments on commit c457043

Please sign in to comment.