From 887d15ed6cca415aca666a7547aff6aaea386632 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 19 Oct 2020 19:26:29 -0600 Subject: [PATCH] Add commentary. --- source/particles/particle.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/particles/particle.cc b/source/particles/particle.cc index eea8eeabd2..d3568e0330 100644 --- a/source/particles/particle.cc +++ b/source/particles/particle.cc @@ -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; -- 2.39.5