Skip to content

Commit

Permalink
Solve leak with metacallcli inspect.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Aug 10, 2022
1 parent aff4c63 commit fde3fbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/cli/metacallcli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@ add_loader_dependencies(${target}
# Define tests
#

add_test(NAME ${target}-inspect-leak
COMMAND ${TEST_COMMAND} "echo 'inspect\nexit' | $<TARGET_FILE:${target}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
set_property(TEST ${target}-inspect-leak
PROPERTY LABELS ${target}-inspect-leak
)
test_environment_variables(${target}-inspect-leak
""
${TESTS_ENVIRONMENT_VARIABLES}
)

if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_NODE AND OPTION_BUILD_SCRIPTS AND OPTION_BUILD_SCRIPTS_NODE)
add_test(NAME ${target}-node
COMMAND ${TEST_COMMAND} "echo 'load node nod.js\ninspect\ncall hello_boy(300, 400)\nexit' | $<TARGET_FILE:${target}> | ${GREP_COMMAND} \"700.0\""
Expand Down
2 changes: 2 additions & 0 deletions source/cli/metacallcli/source/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ void application::command_inspect(const char *str, size_t size, void *allocator)

std::cout << "}" << std::endl;
});

metacall_value_destroy(v);
}

void application::execute(tokenizer &t)
Expand Down

0 comments on commit fde3fbc

Please sign in to comment.