Commit 43980075 authored by Jean-Luc Pons's avatar Jean-Luc Pons

Fixed memory leak

parent 8d637cf1
......@@ -789,7 +789,7 @@ Tango::DevShort AttributeCombiner::devicename2_indice(Tango::DevString argin)
Tango::Except::throw_exception(
(const char *) "AttributeCombiner::error_write",
(const char *) "devicename not found",
(const char *) "AttributeCombiner::disable_device");
(const char *) "AttributeCombiner::devicename2_indice");
/*----- PROTECTED REGION END -----*/ // AttributeCombiner::devicename2_indice
......@@ -1136,7 +1136,12 @@ void AttributeCombiner::add_dynamic_commands()
// Read scalar attribute and combime them to spectrum
outType *readVal = new outType[size];
outType *readSetPoint = new outType[size];
outType *readSetPoint = nullptr;
if( item->rwType == Tango::READ_WRITE ) {
// Allocate memory for setpoint
readSetPoint = new outType[size];
}
for (int i = 0; i < nbDev; i++) {
......@@ -1166,7 +1171,9 @@ void AttributeCombiner::add_dynamic_commands()
}
// Update setpoint value
if (item->rwType == Tango::READ_WRITE) {
Tango::WAttribute &att = getAtt(attName);
att.set_write_value(readSetPoint, size);
......@@ -1179,6 +1186,9 @@ void AttributeCombiner::add_dynamic_commands()
}
memcpy(item->cacheReadPointData, readSetPoint, size * sizeof (outType));
delete readSetPoint;
}
//Update cache
......
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