Commit 8b8460c5 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Refs #12949. Remove release() call.

parent 170e4f0f
......@@ -371,7 +371,7 @@ void AlignDetectors::execEvent() {
// generate the output workspace pointer
API::MatrixWorkspace_sptr matrixOutputWS = getProperty("OutputWorkspace");
if (matrixOutputWS != matrixInputWS) {
matrixOutputWS = MatrixWorkspace_sptr(matrixInputWS->clone().release());
matrixOutputWS = matrixInputWS->clone();
this->setProperty("OutputWorkspace", matrixOutputWS);
}
auto outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
......
......@@ -226,7 +226,7 @@ void BinaryOperation::exec() {
"Contact the developers.");
} else {
// You HAVE to copy the data from lhs to to the output!
m_out = MatrixWorkspace_sptr(m_lhs->clone().release());
m_out = m_lhs->clone();
// Make sure m_eout still points to the same as m_out;
m_eout = boost::dynamic_pointer_cast<EventWorkspace>(m_out);
}
......
......@@ -33,7 +33,7 @@ void ChangeBinOffset::exec() {
const MatrixWorkspace_sptr inputW = getProperty("InputWorkspace");
MatrixWorkspace_sptr outputW = getProperty("OutputWorkspace");
if (outputW != inputW) {
outputW = MatrixWorkspace_sptr(inputW->clone().release());
outputW = inputW->clone();
setProperty("OutputWorkspace", outputW);
}
......
......@@ -53,7 +53,7 @@ void ChangePulsetime::exec() {
EventWorkspace_const_sptr in_ws = getProperty("InputWorkspace");
EventWorkspace_sptr out_ws = getProperty("OutputWorkspace");
if (!out_ws) {
out_ws = EventWorkspace_sptr(in_ws->clone().release());
out_ws = in_ws->clone();
}
// Either use the given list or use all spectra
......
......@@ -37,7 +37,7 @@ void CloneWorkspace::exec() {
if (inputMatrix || iTableWS) {
// Workspace::clone() is polymorphic, we can use the same for all types
Workspace_sptr outputWS(inputWorkspace->clone().release());
Workspace_sptr outputWS(inputWorkspace->clone());
setProperty("OutputWorkspace", outputWS);
} else if (inputMD) {
// Call the CloneMDWorkspace algo to handle MDEventWorkspace
......
......@@ -212,7 +212,7 @@ API::MatrixWorkspace_sptr ConvertUnits::setupOutputWorkspace(
// If input and output workspaces are NOT the same, create a new workspace for
// the output
if (outputWS != inputWS) {
outputWS = MatrixWorkspace_sptr(inputWS->clone().release());
outputWS = inputWS->clone();
}
if (!m_inputEvents && m_distribution) {
......
......@@ -226,7 +226,7 @@ API::MatrixWorkspace_sptr ConvertUnitsUsingDetectorTable::setupOutputWorkspace(
// If input and output workspaces are NOT the same, create a new workspace for
// the output
if (outputWS != inputWS) {
outputWS = MatrixWorkspace_sptr(inputWS->clone().release());
outputWS = inputWS->clone();
}
if (!m_inputEvents && m_distribution) {
......
......@@ -111,7 +111,7 @@ void CorelliCrossCorrelate::exec() {
outputWS = getProperty("OutputWorkspace");
if (outputWS != inputWS) {
outputWS = EventWorkspace_sptr(inputWS->clone().release());
outputWS = inputWS->clone();
}
// Read in chopper sequence from IDF.
......
......@@ -201,7 +201,7 @@ void CorrectKiKf::execEvent() {
// generate the output workspace pointer
API::MatrixWorkspace_sptr matrixOutputWS = getProperty("OutputWorkspace");
if (matrixOutputWS != matrixInputWS) {
matrixOutputWS = MatrixWorkspace_sptr(matrixInputWS->clone().release());
matrixOutputWS = matrixInputWS->clone();
setProperty("OutputWorkspace", matrixOutputWS);
}
auto outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
......
......@@ -85,7 +85,7 @@ void FilterByXValue::exec() {
// entail new methods (e.g. iterators) on EventList as this algorithm
// shouldn't
// need to know about the type of the events (e.g. weighted).
outputWS = EventWorkspace_sptr(inputWS->clone().release());
outputWS = inputWS->clone();
setProperty("OutputWorkspace", outputWS);
}
......
......@@ -416,8 +416,7 @@ void He3TubeEfficiency::execEvent() {
// generate the output workspace pointer
API::MatrixWorkspace_sptr matrixOutputWS = getProperty("OutputWorkspace");
if (matrixOutputWS != matrixInputWS) {
matrixOutputWS =
API::MatrixWorkspace_sptr(matrixInputWS->clone().release());
matrixOutputWS = matrixInputWS->clone();
setProperty("OutputWorkspace", matrixOutputWS);
}
auto outputWS =
......
......@@ -94,7 +94,7 @@ void MaskBins::exec() {
// Only create the output workspace if it's different to the input one
MatrixWorkspace_sptr outputWS = getProperty("OutputWorkspace");
if (outputWS != inputWS) {
outputWS = MatrixWorkspace_sptr(inputWS->clone().release());
outputWS = inputWS->clone();
setProperty("OutputWorkspace", outputWS);
}
......
......@@ -264,7 +264,7 @@ void MergeRuns::execEvent() {
// Create a new output event workspace, by copying the first WS in the list
EventWorkspace_sptr inputWS = m_inEventWS[0];
EventWorkspace_sptr outWS(inputWS->clone().release());
EventWorkspace_sptr outWS(inputWS->clone());
int64_t n = m_inEventWS.size() - 1;
m_progress = new Progress(this, 0.0, 1.0, n);
......
......@@ -249,7 +249,7 @@ void ModeratorTzero::execEvent(const std::string &emode) {
// generate the output workspace pointer
API::MatrixWorkspace_sptr matrixOutputWS = getProperty("OutputWorkspace");
if (matrixOutputWS != matrixInputWS) {
matrixOutputWS = MatrixWorkspace_sptr(matrixInputWS->clone().release());
matrixOutputWS = matrixInputWS->clone();
setProperty("OutputWorkspace", matrixOutputWS);
}
auto outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
......
......@@ -185,7 +185,7 @@ void ModeratorTzeroLinear::execEvent() {
// generate the output workspace pointer
MatrixWorkspace_sptr matrixOutputWS = getProperty("OutputWorkspace");
if (matrixOutputWS != matrixInputWS) {
matrixOutputWS = MatrixWorkspace_sptr(matrixInputWS->clone().release());
matrixOutputWS = matrixInputWS->clone();
setProperty("OutputWorkspace", matrixOutputWS);
}
auto outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
......
......@@ -163,7 +163,7 @@ void MultipleScatteringCylinderAbsorption::exec() {
// not in-place so create a new copy
MatrixWorkspace_sptr out_WS = getProperty("OutputWorkspace");
if (in_WS != out_WS) {
out_WS = MatrixWorkspace_sptr(in_WS->clone().release());
out_WS = in_WS->clone();
}
auto out_WSevent = boost::dynamic_pointer_cast<EventWorkspace>(out_WS);
......
......@@ -566,7 +566,7 @@ void NormaliseToMonitor::normaliseBinByBin(
// Only create output workspace if different to input one
if (outputWorkspace != inputWorkspace) {
if (inputEvent) {
outputWorkspace = MatrixWorkspace_sptr(inputWorkspace->clone().release());
outputWorkspace = inputWorkspace->clone();
} else
outputWorkspace = WorkspaceFactory::Instance().create(inputWorkspace);
}
......
......@@ -147,7 +147,7 @@ void Rebin::exec() {
if (PreserveEvents) {
if (!inPlace) {
outputWS = MatrixWorkspace_sptr(inputWS->clone().release());
outputWS = inputWS->clone();
}
auto eventOutputWS =
boost::dynamic_pointer_cast<EventWorkspace>(outputWS);
......
......@@ -542,7 +542,7 @@ ReflectometryReductionOneAuto::sumOverTransmissionGroup(
// We used .release because clone() will return a unique_ptr.
// we need to release the ownership of the pointer so that it
// can be cast into a shared_ptr of type Workspace.
Workspace_sptr transmissionRunSum(transGroup->getItem(0)->clone().release());
Workspace_sptr transmissionRunSum(transGroup->getItem(0)->clone());
// make a variable to store the overall total of the summation
MatrixWorkspace_sptr total;
......
......@@ -123,7 +123,7 @@ void RemoveLowResTOF::exec() {
// Only create the output workspace if it's different to the input one
MatrixWorkspace_sptr outputWS = getProperty("OutputWorkspace");
if (outputWS != m_inputWS) {
outputWS = MatrixWorkspace_sptr(m_inputWS->clone().release());
outputWS = m_inputWS->clone();
setProperty("OutputWorkspace", outputWS);
}
......@@ -168,7 +168,7 @@ void RemoveLowResTOF::execEvent() {
MatrixWorkspace_sptr matrixLowResW = getProperty("LowResTOFWorkspace");
if (m_outputLowResTOF) {
matrixLowResW = MatrixWorkspace_sptr(m_inputWS->clone().release());
matrixLowResW = m_inputWS->clone();
setProperty("LowResTOFWorkspace", matrixLowResW);
}
auto lowW = boost::dynamic_pointer_cast<EventWorkspace>(matrixLowResW);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment