From d43c566fa29bbc0da1534aea236d54ee5ca104b8 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 14 Dec 2018 15:24:21 -0500 Subject: Fix memory leaks around slang-test (#757) * Remove circular reference to renderer on Vk & D3D12 DescriptorSetImpl * Refactor Stbi image loading such that memory is correctly freed when goes out of scope. Added Crt memory dump at termination. Reduced erroneous reporting by scoping TestContext. * Used capitalized acronym for STBImage to keep Tim happy. * Split out TestReporter - to just handle reporting test results Split out Options Made TestContext hold options, and the reporter Removed remaining memory leaks. * Small optimization for rawWrite, such that it directly writes over print.. * Improve comments on TestCategorySet * Fix typos in TestCategorySet --- tools/slang-reflection-test/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/slang-reflection-test/main.cpp') diff --git a/tools/slang-reflection-test/main.cpp b/tools/slang-reflection-test/main.cpp index 41a21eee8..ad474ee70 100644 --- a/tools/slang-reflection-test/main.cpp +++ b/tools/slang-reflection-test/main.cpp @@ -18,7 +18,8 @@ struct PrettyWriter static void writeRaw(PrettyWriter& writer, char const* begin, char const* end) { - Slang::AppContext::getStdOut().print("%.*s", int(end - begin), begin); + SLANG_ASSERT(end >= begin); + Slang::AppContext::getStdOut().write(begin, size_t(end - begin)); } static void writeRaw(PrettyWriter& writer, char const* begin) -- cgit v1.2.3