From 27d0a2f33e93dcd226ac4ac1ccab7b5c1e72c518 Mon Sep 17 00:00:00 2001 From: ado Date: Sun, 27 Mar 2022 21:41:46 +0200 Subject: [PATCH] fix minor memory leask --- hbuild/install_manifest.txt | 2 +- include/ss/parser.hpp | 2 +- test/meson.build | 6 +++--- test/test_parser.cpp | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hbuild/install_manifest.txt b/hbuild/install_manifest.txt index b44f5c0..3edc4ee 100644 --- a/hbuild/install_manifest.txt +++ b/hbuild/install_manifest.txt @@ -3,10 +3,10 @@ /usr/local/include/ss/splitter.hpp /usr/local/include/ss/common.hpp /usr/local/include/ss/type_traits.hpp +/usr/local/include/ss/converter.hpp /usr/local/include/ss/extract.hpp /usr/local/include/ss/setup.hpp /usr/local/include/ss/parser.hpp -/usr/local/include/ss/converter.hpp /usr/local/include/fast_float/ascii_number.h /usr/local/include/fast_float/decimal_to_binary.h /usr/local/include/fast_float/fast_float.h diff --git a/include/ss/parser.hpp b/include/ss/parser.hpp index b786871..5f91fda 100644 --- a/include/ss/parser.hpp +++ b/include/ss/parser.hpp @@ -509,7 +509,7 @@ private: helper_buffer_{other.helper_buffer_}, converter_{std::move( other.converter_)}, next_line_converter_{std::move(other.next_line_converter_)}, - size_{other.size_}, next_line_size_{other.size_}, + size_{other.size_}, next_line_size_{other.next_line_size_}, helper_size_{other.helper_size_}, delim_{std::move(other.delim_)}, file_{other.file_}, crlf_{other.crlf_}, line_number_{ other.line_number_} { diff --git a/test/meson.build b/test/meson.build index 708f9ad..a8596eb 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,9 +1,9 @@ test_sources = files([ 'test_main.cpp', - #'test_splitter.cpp', - #'test_converter.cpp', + 'test_splitter.cpp', + 'test_converter.cpp', 'test_parser.cpp', - #'test_extractions.cpp', + 'test_extractions.cpp', ]) doctest_proj = subproject('doctest') diff --git a/test/test_parser.cpp b/test/test_parser.cpp index bb9427f..60fbce9 100644 --- a/test/test_parser.cpp +++ b/test/test_parser.cpp @@ -108,6 +108,8 @@ TEST_CASE("parser test various cases") { make_and_write(f.name, data); { ss::parser p{f.name, ","}; + ss::parser p0{std::move(p)}; + p = std::move(p0); std::vector i; ss::parser p2{f.name, ","};