diff --git a/src/MCCE2Electrometers.cpp b/src/MCCE2Electrometers.cpp index 63993d84be155e95b1aa1b703cfe1d902031880c..0bc8222fb7693aa39cee27c9b0c2af270d198367 100644 --- a/src/MCCE2Electrometers.cpp +++ b/src/MCCE2Electrometers.cpp @@ -159,18 +159,6 @@ void MCCE2Electrometers::delete_device() // Delete device allocated objects // Delete device's allocated object - if(this->_electrometerCH1) - { - delete this->_electrometerCH1; - this->_electrometerCH1 = 0; - } - - if(this->_electrometerCH2) - { - delete this->_electrometerCH2; - this->_electrometerCH2 = 0; - } - DELETE_DEVSTRING_ATTRIBUTE(attr_range1_read); DELETE_DEVSTRING_ATTRIBUTE(attr_range2_read); DELETE_SCALAR_ATTRIBUTE(attr_electrometerChannel_read); @@ -520,7 +508,7 @@ void MCCE2Electrometers::write_electrometerChannel(Tango::WAttribute &attr) { WARN_STREAM << "Cannot control electrometer on this channel : seems that nothing is connected on!" << std::endl; // nothing is connected on this channel - *attr_range1_read = &_notConnectedStr[0]; + strcpy(*attr_range1_read,_notConnectedStr.c_str()); } } else if ( w_val == ELETRO_CHANNEL_TWO ) @@ -538,7 +526,7 @@ void MCCE2Electrometers::write_electrometerChannel(Tango::WAttribute &attr) { WARN_STREAM << "Cannot control electrometer on this channel : seems that nothing is connected on!" << std::endl; //- warn nothing is connected on this channel - *attr_range2_read = &_notConnectedStr[0]; + strcpy(*attr_range2_read,_notConnectedStr.c_str()); } } attr_electrometerChannel_write = w_val; @@ -559,7 +547,7 @@ void MCCE2Electrometers::read_range1(Tango::Attribute &attr) /*----- PROTECTED REGION ID(MCCE2Electrometers::read_range1) ENABLED START -----*/ if ( !this->_electrometerCH1 ) { - *attr_range1_read = &_notConnectedStr[0]; + strcpy(*attr_range1_read,_notConnectedStr.c_str()); } else { @@ -589,7 +577,7 @@ void MCCE2Electrometers::read_range2(Tango::Attribute &attr) /*----- PROTECTED REGION ID(MCCE2Electrometers::read_range2) ENABLED START -----*/ if ( !this->_electrometerCH2 ) { - *attr_range2_read = &_notConnectedStr[0]; + strcpy(*attr_range2_read,_notConnectedStr.c_str()); } else {