From 8febc0415b700849be451d637083447f307386e2 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 4 Mar 2013 14:35:06 +0000 Subject: [PATCH] BUG: Corrected TimeDataEntry copy constructor - mantis #753 --- .../TimeDataEntry/TimeDataEntry/TimeDataEntry.C | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C b/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C index b5e74a78c0..5165de7e52 100644 --- a/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C +++ b/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,8 +60,13 @@ Foam::TimeDataEntry::TimeDataEntry : time_(tde.time_), name_(tde.name_), - entry_(tde.entry_->clone().ptr()) -{} + entry_() +{ + if (entry_.valid()) + { + entry_.reset(tde.entry_->clone().ptr()); + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //