提交 f8bcc9d1 authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #883 in FS/freeswitch from…

Merge pull request #883 in FS/freeswitch from ~LORNI/freeswitch:feature/FS-9256-add-db.finalize-in-order-to-close to master

* commit '36ffb292':
  FS-9256: mod_v8: Add DB.Finalize() in order to close statements.
......@@ -72,6 +72,7 @@ public:
JS_COREDB_FUNCTION_DEF(Prepare);
JS_COREDB_FUNCTION_DEF(BindText);
JS_COREDB_FUNCTION_DEF(BindInt);
JS_COREDB_FUNCTION_DEF(Finalize);
JS_COREDB_GET_PROPERTY_DEF(GetProperty);
};
......
......@@ -232,6 +232,14 @@ JS_COREDB_FUNCTION_IMPL(Step)
StepEx(info, SWITCH_CORE_DB_DONE);
}
JS_COREDB_FUNCTION_IMPL(Finalize)
{
if (_stmt) {
switch_core_db_finalize(_stmt);
_stmt = NULL;
}
}
JS_COREDB_FUNCTION_IMPL(Fetch)
{
HandleScope handle_scope(info.GetIsolate());
......@@ -415,6 +423,7 @@ static const js_function_t db_methods[] = {
{"prepare", FSCoreDB::Prepare},
{"bindText", FSCoreDB::BindText},
{"bindInt", FSCoreDB::BindInt},
{"finalize", FSCoreDB::Finalize},
{0}
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论