Skip to content

Commit a86a99d

Browse files
committed
修复运行时少量的内存泄漏
1 parent 32fd6b0 commit a86a99d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CodeFormatServer/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ target_sources(CodeFormatServer
4444

4545
target_link_libraries(CodeFormatServer PUBLIC CodeService)
4646

47+
4748
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
4849
target_compile_definitions(CodeFormatServer PUBLIC -D_WIN32_WINNT=0x0601)
4950
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")

CodeService/src/LuaEditorConfig.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void LuaEditorConfig::Parse()
8383

8484
std::shared_ptr<LuaCodeStyleOptions> LuaEditorConfig::Generate(std::string_view fileUri)
8585
{
86-
auto options = std::make_shared<LuaCodeStyleOptions>();
86+
std::shared_ptr<LuaCodeStyleOptions> options = nullptr;
8787

8888
std::string patternKey;
8989
std::vector<std::shared_ptr<Section>> luaSections;
@@ -148,6 +148,7 @@ std::shared_ptr<LuaCodeStyleOptions> LuaEditorConfig::Generate(std::string_view
148148
}
149149
else
150150
{
151+
options = std::make_shared<LuaCodeStyleOptions>();
151152
for (auto luaSection : luaSections)
152153
{
153154
ParseFromSection(options, luaSection->ConfigMap);

0 commit comments

Comments
 (0)