From 30dacdade27a46317635ba800c6bc79a949e55be Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 7 Oct 2017 21:47:55 +0800 Subject: [PATCH] Regex: deallocate Saves memory on ThreadedRegexVM destruction --- src/regex_impl.cc | 1 - src/regex_impl.hh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 659a84ec..e7991d14 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -883,7 +883,6 @@ struct TestVM : CompiledRegex, ThreadedRegexVM } auto test_regex = UnitTest{[]{ - { TestVM<> vm{R"(a*b)"}; kak_assert(vm.exec("b")); diff --git a/src/regex_impl.hh b/src/regex_impl.hh index d7457043..535cdf92 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -118,6 +118,7 @@ public: for (size_t i = m_program.save_count-1; i > 0; --i) saves->pos[i].~Iterator(); saves->~Saves(); + ::operator delete(saves, sizeof(Saves) + (m_program.save_count-1) * sizeof(Iterator)); } }