diff options
author | Don Anderson <dda@ddanderson.com> | 2015-11-04 06:44:25 -0500 |
---|---|---|
committer | Don Anderson <dda@ddanderson.com> | 2015-11-04 06:44:25 -0500 |
commit | 4126e77abed6d7d36dd4c0d9979c2ba06b2ce783 (patch) | |
tree | 35a9b0fbebc73720ea1df66b8321a413fb35d2f4 /lang | |
parent | 10f881b0116109ec30c2b6b4b52d2bc1d216d2e3 (diff) | |
parent | ff27fe9e03e067efea34757069b41f6e5efbdf54 (diff) | |
download | mongo-4126e77abed6d7d36dd4c0d9979c2ba06b2ce783.tar.gz |
Merge branch 'develop' into wt-1315-join-cursor
Diffstat (limited to 'lang')
-rw-r--r-- | lang/java/wiredtiger.i | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lang/java/wiredtiger.i b/lang/java/wiredtiger.i index ae370ec89f5..1326b9ebb90 100644 --- a/lang/java/wiredtiger.i +++ b/lang/java/wiredtiger.i @@ -395,15 +395,20 @@ javaCloseHandler(WT_EVENT_HANDLER *handler, WT_SESSION *session, WT_CURSOR *cursor) { int ret; + JAVA_CALLBACK *jcb; WT_UNUSED(handler); - if (cursor != NULL) - ret = cursorCloseHandler(NULL, session, (JAVA_CALLBACK *) - cursor->lang_private); - else - ret = closeHandler(NULL, session, (JAVA_CALLBACK *) - ((WT_SESSION_IMPL *)session)->lang_private); + ret = 0; + if (cursor != NULL) { + if ((jcb = (JAVA_CALLBACK *)cursor->lang_private) != NULL) { + ret = cursorCloseHandler(NULL, session, jcb); + cursor->lang_private = NULL; + } + } else if ((jcb = ((WT_SESSION_IMPL *)session)->lang_private) != NULL) { + ret = closeHandler(NULL, session, jcb); + ((WT_SESSION_IMPL *)session)->lang_private = NULL; + } return (ret); } |