From: Wolfgang Bangerth Date: Tue, 7 Jun 2016 13:53:07 +0000 (-0500) Subject: First call the signal, then destroy the object. X-Git-Tag: v8.5.0-rc1~981^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2673%2Fhead;p=dealii.git First call the signal, then destroy the object. --- diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 7b9684280c..9608ad3986 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -2023,6 +2023,12 @@ public: * is called. This signal is also triggered when loading a triangulation * from an archive via Triangulation::load() as the previous content of * the triangulation is first destroyed. + * + * The signal is triggered before the data structures of the + * triangulation are destroyed. In other words, the functions + * attached to this signal get a last look at the triangulation, + * for example to save information stored as part of the + * triangulation. */ boost::signals2::signal clear; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 4b76e7b8d5..31b117337e 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -9024,13 +9024,13 @@ Triangulation::~Triangulation () template void Triangulation::clear () { - // clear all content of the triangulation... + // notify listeners that the triangulation is going down... + signals.clear(); + + // ...and then actually clear all content of it clear_despite_subscriptions(); periodic_face_pairs_level_0.clear(); periodic_face_map.clear(); - - // ...and then notify listeners to it - signals.clear(); }