From 57d00a074cc8be43b2c74597dd3c7d28f650cd59 Mon Sep 17 00:00:00 2001 From: Samuel Jackson Date: Mon, 28 Apr 2014 11:38:38 +0100 Subject: [PATCH] Refs #8913 Fix bug(s) with copying algorithm history objects. --- Code/Mantid/Framework/API/src/AlgorithmHistory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Code/Mantid/Framework/API/src/AlgorithmHistory.cpp b/Code/Mantid/Framework/API/src/AlgorithmHistory.cpp index 76df6f1f88c3..ccecd4f99737 100644 --- a/Code/Mantid/Framework/API/src/AlgorithmHistory.cpp +++ b/Code/Mantid/Framework/API/src/AlgorithmHistory.cpp @@ -88,6 +88,12 @@ void AlgorithmHistory::addExecutionInfo(const DateAndTime& start, const double& */ void AlgorithmHistory::addChildHistory(const AlgorithmHistory& childHist) { + // Don't copy one's own history onto oneself + if (this == &childHist) + { + return; + } + m_childHistories.insert(childHist); } @@ -168,6 +174,7 @@ AlgorithmHistory& AlgorithmHistory::operator=(const AlgorithmHistory& A) m_executionDate=A.m_executionDate; m_executionDuration=A.m_executionDuration; m_properties=A.m_properties; + m_childHistories=A.m_childHistories; } return *this; }