From: Martin Kronbichler Date: Thu, 18 Jul 2019 12:29:22 +0000 (+0200) Subject: Be more conservative in clearing the cache of MappingQCache X-Git-Tag: v9.2.0-rc1~1376^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8390%2Fhead;p=dealii.git Be more conservative in clearing the cache of MappingQCache --- diff --git a/source/fe/mapping_q_cache.cc b/source/fe/mapping_q_cache.cc index 32d5bb7491..9c7cae10e6 100644 --- a/source/fe/mapping_q_cache.cc +++ b/source/fe/mapping_q_cache.cc @@ -42,8 +42,12 @@ MappingQCache::MappingQCache( template MappingQCache::~MappingQCache() { - if (clear_signal.connected()) - clear_signal.disconnect(); + // When this object goes out of scope, we want the cache to get cleared and + // free its memory before the signal is disconnected in order to not work on + // invalid memory that has been left back by freeing an object of this + // class. + support_point_cache.reset(); + clear_signal.disconnect(); }