]> https://gitweb.dealii.org/ - dealii.git/commitdiff
First call the signal, then destroy the object. 2673/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 7 Jun 2016 13:53:07 +0000 (08:53 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 7 Jun 2016 13:53:07 +0000 (08:53 -0500)
include/deal.II/grid/tria.h
source/grid/tria.cc

index 7b9684280c31620a79b92dcd76d7a7e0e85e9b43..9608ad3986eb8af606aad7e621db96c38567270a 100644 (file)
@@ -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<void ()> clear;
 
index 4b76e7b8d5034881a4dd9eef60d46d6d76d1951e..31b117337ef0bb3581635b2111f3ad49b184c722 100644 (file)
@@ -9024,13 +9024,13 @@ Triangulation<dim, spacedim>::~Triangulation ()
 template <int dim, int spacedim>
 void Triangulation<dim, spacedim>::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();
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.