Skip to content

Commit

Permalink
Refs #5021 fix thread-safety issue in ConvertToDiffractionMDWorkspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Mar 27, 2012
1 parent 2ba3a6b commit 7c75c51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/DataObjects/src/EventList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ namespace DataObjects

// Get the input histogram
const MantidVec & X = inSpec->readX();
const MantidVec & Y = inSpec->readY();
const MantidVec & E = inSpec->readE();
// To be more thread-safe, we are getting a COPY of the vectors.
// This is probably because the MRU can drop off, deleting the vector while we are using it.
MantidVec Y = inSpec->readY();
MantidVec E = inSpec->readE();
if (Y.size()+1 != X.size())
throw std::runtime_error("Expected a histogram (X vector should be 1 longer than the Y vector)");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ class ConvertToDiffractionMDWorkspaceTest : public CxxTest::TestSuite
do_test_MINITOPAZ(TOF, 2);
}

/// FIXME: this fails on Ubuntu, sometimes?
void xtest_MINITOPAZ_OneEventPerBin()
void test_MINITOPAZ_OneEventPerBin()
{
do_test_MINITOPAZ(TOF, 1, true);
}
Expand Down

0 comments on commit 7c75c51

Please sign in to comment.