From 48b0f421785aed46243847ce8374d16f5770edc7 Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Fri, 19 Apr 2024 10:08:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DsqliteBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/quanta/src/mainlib.cpp | 7 +++++++ core/quanta/src/mainlib.h | 1 + script/driver/sqlite.lua | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) 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