Skip to content

Commit 6179869

Browse files
hs0225daeyeon
authored andcommitted
fix(device-api): initialize module only once
Signed-off-by: Hosung Kim hs852.kim@samsung.com
1 parent 7b3728a commit 6179869

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/packages/device-api/src/DeviceAPIModule.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ static void runInitialScript(napi_env env) {
4545
}
4646

4747
static napi_value InitMethod(napi_env env, napi_callback_info info) {
48+
static bool once = false;
49+
if (once) {
50+
return nullptr;
51+
}
52+
once = true;
53+
4854
napi_context context;
4955

5056
NAPI_CALL(napi_get_context(env, context));

0 commit comments

Comments
 (0)