1From ce61278b04ee201de1e3aafee138b562c7473bd8 Mon Sep 17 00:00:00 2001 2From: fangzhou12 <fangzhou12@huawei.com> 3Date: Tue, 13 Jun 2023 20:12:13 +0800 4Subject: [PATCH] callback bugfix 5 6--- 7 include/js_api/common_napi.h | 2 +- 8 include/js_api/mslite_model_napi.h | 2 +- 9 2 files changed, 2 insertions(+), 2 deletions(-) 10 11diff --git a/include/js_api/common_napi.h b/include/js_api/common_napi.h 12index c52f3b80..415f813e 100644 13--- a/include/js_api/common_napi.h 14+++ b/include/js_api/common_napi.h 15@@ -60,7 +60,7 @@ struct ModelInfo { 16 std::string model_path = ""; 17 char *model_buffer_data = nullptr; 18 size_t model_buffer_total = 0; 19- size_t model_fd = 0; 20+ int32_t model_fd = 0; 21 ModelMode mode = kBuffer; 22 }; 23 24diff --git a/include/js_api/mslite_model_napi.h b/include/js_api/mslite_model_napi.h 25index f570d232..be1c5167 100644 26--- a/include/js_api/mslite_model_napi.h 27+++ b/include/js_api/mslite_model_napi.h 28@@ -37,7 +37,7 @@ class MSLiteModelNapi { 29 private: 30 struct MSLiteModelAsyncContext { 31 napi_async_work work; 32- napi_deferred deferred; 33+ napi_deferred deferred = nullptr; 34 napi_ref callbackRef = nullptr; 35 int32_t status = SUCCESS; 36 MSLiteModelNapi *lite_model = nullptr; 37-- 382.17.1 39 40