]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add commentary.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 20 Oct 2020 01:26:29 +0000 (19:26 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 20 Oct 2020 02:46:50 +0000 (20:46 -0600)
source/particles/particle.cc

index eea8eeabd27a4f04b85078a240d8d476e852fb20..d3568e0330687d39e9f0519cb11b13cc5c34a9eb 100644 (file)
@@ -157,11 +157,15 @@ namespace Particles
   {
     if (this != &particle)
       {
-        location            = particle.location;
-        reference_location  = particle.reference_location;
-        id                  = particle.id;
-        property_pool       = particle.property_pool;
-        properties          = particle.properties;
+        location           = particle.location;
+        reference_location = particle.reference_location;
+        id                 = particle.id;
+        property_pool      = particle.property_pool;
+        properties         = particle.properties;
+
+        // We stole the rhs's properties, so we need to invalidate
+        // the handle the rhs holds lest it releases the memory that
+        // we still reference here.
         particle.properties = PropertyPool::invalid_handle;
       }
     return *this;

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.