diff --git a/ecmascript/jspandafile/js_pandafile_manager.cpp b/ecmascript/jspandafile/js_pandafile_manager.cpp index 3ed95251d0a74c86ff10148a86d7fafb276db882..7b3c8f765fad19b52d1e5ae97c0a68993db35ce4 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; }