From 90a29fe23e537a02a348240c32f51e9ddc2203fe Mon Sep 17 00:00:00 2001 From: wengchangcheng Date: Thu, 3 Mar 2022 23:38:31 +0800 Subject: [PATCH] fix js pandafile reference count increase refrence count when found the same pandafile https://gitee.com/openharmony/ark_js_runtime/issues/I4W89X Signed-off-by: wengchangcheng Change-Id: I99f923f2a9a89d8bf99473034356461f92e46bf1 --- ecmascript/jspandafile/js_pandafile_manager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ecmascript/jspandafile/js_pandafile_manager.cpp b/ecmascript/jspandafile/js_pandafile_manager.cpp index 3ed95251d0..7b3c8f765f 100644 --- a/ecmascript/jspandafile/js_pandafile_manager.cpp +++ b/ecmascript/jspandafile/js_pandafile_manager.cpp @@ -35,6 +35,7 @@ const JSPandaFile *JSPandaFileManager::LoadPfAbc(const std::string &filename) CString desc = ConvertToString(filename); const JSPandaFile *jsPandaFile = FindJSPandaFile(desc); if (jsPandaFile != nullptr) { + IncreaseRefJSPandaFile(jsPandaFile); return jsPandaFile; } @@ -57,6 +58,7 @@ const JSPandaFile *JSPandaFileManager::LoadBufferAbc(const std::string &filename CString desc = ConvertToString(filename); const JSPandaFile *jsPandaFile = FindJSPandaFile(desc); if (jsPandaFile != nullptr) { + IncreaseRefJSPandaFile(jsPandaFile); return jsPandaFile; } -- Gitee