From 1cea0b5913f156abcbc1077425337a24e21a4ab5 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Mon, 6 Nov 2017 09:03:15 -0500 Subject: [PATCH] fixed leaky Engine::initialize() used by Engine::set_{oper,param,braket} (HT Gustav Baardsen ) --- CHANGES | 3 +++ include/libint2/engine.h | 2 ++ include/libint2/engine.impl.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index b990bea85..7a7b52e7d 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,9 @@ Following is a brief summary of changes made in each release of Libint. +- 2017-xx-yy: 2.4.1 + - plugged leaky Engine::set_{param,oper,braket} + - 2017-10-25: 2.4.0 - changed default to use user-provided boost over bundled boost + minor fixes diff --git a/include/libint2/engine.h b/include/libint2/engine.h index 1a94a62ad..ecdf6a3da 100644 --- a/include/libint2/engine.h +++ b/include/libint2/engine.h @@ -468,8 +468,10 @@ class Engine { Params params = empty_pod(), BraKet braket = BraKet::invalid) : oper_(oper), braket_(braket), + primdata_(), spbra_(max_nprim), spket_(max_nprim), + stack_size_(0), lmax_(max_l), deriv_order_(deriv_order), params_(enforce_params_type(oper, params)) { diff --git a/include/libint2/engine.impl.h b/include/libint2/engine.impl.h index 97bacba89..3594fc4f5 100644 --- a/include/libint2/engine.impl.h +++ b/include/libint2/engine.impl.h @@ -589,6 +589,8 @@ __libint2_engine_inline void Engine::_initialize() { BOOST_PP_STRINGIZE(BOOST_PP_NBODYENGINE_MCR3_TASK(product)), \ hard_lmax_, lmax_); \ } \ + if (stack_size_ > 0) \ + libint2_cleanup_default(&primdata_[0]); \ stack_size_ = LIBINT2_PREFIXED_NAME(BOOST_PP_CAT( \ libint2_need_memory_, BOOST_PP_NBODYENGINE_MCR3_TASK(product)))( \ lmax_); \