Always check for exception JavaClass.call_constructor()

This commit is contained in:
Peter Badida 2019-01-31 19:09:56 +01:00
parent 144f71c2b3
commit 83a9a00cf3
1 changed files with 4 additions and 0 deletions

View File

@ -348,6 +348,10 @@ cdef class JavaClass(object):
self.j_self = create_local_ref(j_env, j_self)
j_env[0].DeleteLocalRef(j_env, j_self)
finally:
# in case NewObjectA() throws an exception,
# the execution might not get further, but 'finally' block
# will still be called
check_exception(j_env)
if j_args != NULL:
free(j_args)