diff --git a/core/quanta/src/mainlib.cpp b/core/quanta/src/mainlib.cpp index f8f0c428..4068585b 100644 --- a/core/quanta/src/mainlib.cpp +++ b/core/quanta/src/mainlib.cpp @@ -85,6 +85,13 @@ QUANTA_API const char* call_quanta(const char* func) { return ""; } +QUANTA_API void stop_quanta() { + if (q_app) { + delete q_app; + q_app = nullptr; + } +} + QUANTA_API int run_quanta() { if (q_app) {; if (!q_app->step()) { diff --git a/core/quanta/src/mainlib.h b/core/quanta/src/mainlib.h index 07822da2..63aaed8c 100644 --- a/core/quanta/src/mainlib.h +++ b/core/quanta/src/mainlib.h @@ -15,6 +15,7 @@ extern "C" { #endif QUANTA_API int run_quanta(); +QUANTA_API void stop_quanta(); QUANTA_API int init_quanta(const char* zfile, const char* fconf); QUANTA_API const char* call_quanta(const char* func); diff --git a/script/driver/sqlite.lua b/script/driver/sqlite.lua index b8f17790..85c2d971 100644 --- a/script/driver/sqlite.lua +++ b/script/driver/sqlite.lua @@ -82,7 +82,7 @@ function Sqlite:put(primary_id, data, sheet) return true end -function Sqlite:get(sheet, primary_id) +function Sqlite:get(primary_id, sheet) log_debug("[Sqlite][get] sheet:{} primary_id:{}", sheet, primary_id) local rc, data = self:get_prepare(sheet).select.run(primary_id) if rc == SQLITE_NFOUND or rc == SQLITE_DONE then