summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorDon Anderson <dda@ddanderson.com>2015-11-04 06:44:25 -0500
committerDon Anderson <dda@ddanderson.com>2015-11-04 06:44:25 -0500
commit4126e77abed6d7d36dd4c0d9979c2ba06b2ce783 (patch)
tree35a9b0fbebc73720ea1df66b8321a413fb35d2f4 /lang
parent10f881b0116109ec30c2b6b4b52d2bc1d216d2e3 (diff)
parentff27fe9e03e067efea34757069b41f6e5efbdf54 (diff)
downloadmongo-4126e77abed6d7d36dd4c0d9979c2ba06b2ce783.tar.gz
Merge branch 'develop' into wt-1315-join-cursor
Diffstat (limited to 'lang')
-rw-r--r--lang/java/wiredtiger.i17
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);
}