Merge remote-tracking branch 'origin/gsb-async-nifs3' into gsb-async-nifs3
This commit is contained in:
commit
5e80477d4a
2 changed files with 9 additions and 5 deletions
5
Makefile
5
Makefile
|
@ -20,9 +20,8 @@ update-deps:
|
||||||
c_src/build_deps.sh update-deps
|
c_src/build_deps.sh update-deps
|
||||||
@$(REBAR) update-deps
|
@$(REBAR) update-deps
|
||||||
|
|
||||||
c_src/wterl.c: c_src/async_nif.h
|
c_src/wterl.o: c_src/async_nif.h
|
||||||
|
touch c_src/wterl.c
|
||||||
c_src/wterl.o: c_src/wterl.c
|
|
||||||
|
|
||||||
ebin/app_helper.beam:
|
ebin/app_helper.beam:
|
||||||
@echo You need to:
|
@echo You need to:
|
||||||
|
|
|
@ -134,9 +134,10 @@ __close_all_sessions(WterlConnHandle *conn_handle)
|
||||||
khiter_t itr;
|
khiter_t itr;
|
||||||
for (itr = kh_begin(h); itr != kh_end(h); ++itr) {
|
for (itr = kh_begin(h); itr != kh_end(h); ++itr) {
|
||||||
if (kh_exist(h, itr)) {
|
if (kh_exist(h, itr)) {
|
||||||
// WT_CURSOR *cursor = kh_val(h, itr);
|
WT_CURSOR *cursor = kh_val(h, itr);
|
||||||
// cursor->close(cursor);
|
|
||||||
char *key = (char *)kh_key(h, itr);
|
char *key = (char *)kh_key(h, itr);
|
||||||
|
cursor->close(cursor);
|
||||||
|
kh_del(cursors, h, itr);
|
||||||
enif_free(key);
|
enif_free(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,6 +288,10 @@ ASYNC_NIF_DECL(
|
||||||
int rc = wiredtiger_open(args->homedir, NULL, config.data[0] != 0 ? (const char*)config.data : NULL, &conn);
|
int rc = wiredtiger_open(args->homedir, NULL, config.data[0] != 0 ? (const char*)config.data : NULL, &conn);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
WterlConnHandle *conn_handle = enif_alloc_resource(wterl_conn_RESOURCE, sizeof(WterlConnHandle));
|
WterlConnHandle *conn_handle = enif_alloc_resource(wterl_conn_RESOURCE, sizeof(WterlConnHandle));
|
||||||
|
if (!conn_handle) {
|
||||||
|
ASYNC_NIF_REPLY(__strerror_term(env, ENOMEM));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (session_config.size > 1) {
|
if (session_config.size > 1) {
|
||||||
char *sc = enif_alloc(session_config.size);
|
char *sc = enif_alloc(session_config.size);
|
||||||
if (!sc) {
|
if (!sc) {
|
||||||
|
|
Loading…
Reference in a new issue