diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/Runtime.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/Runtime.cpp index 5f60ac5808..16d3d635e4 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/Runtime.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/Runtime.cpp @@ -376,10 +376,6 @@ bool CreateDir(const char *sPathName) void updateResFileInfo(string filename,string filetime) { - if(!g_filecfgjson.IsObject()) - { - g_filecfgjson.SetObject(); - } if (g_filecfgjson.HasMember(filename.c_str())) { g_filecfgjson.RemoveMember(filename.c_str()); } @@ -414,8 +410,12 @@ void readResFile() { rapidjson::FileStream inputStream(pFile); g_filecfgjson.ParseStream<0>(inputStream); + fclose(pFile); + } + if(!g_filecfgjson.IsObject()) + { + g_filecfgjson.SetObject(); } - fclose(pFile); } bool FileServer::recv_file(int fd)