uniqe ptr for receiver

This commit is contained in:
Erik Frojdh 2019-05-27 11:28:59 +02:00
parent 0972b803dd
commit 8ebc0f2644
2 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,8 @@
class MySocketTCP;
class ServerInterface;
class slsReceiverImplementation;
// class slsReceiverImplementation;
#include "slsReceiverImplementation.h"
#include "ServerSocket.h"
@ -306,7 +307,7 @@ class slsReceiverTCPIPInterface : private virtual slsDetectorDefs {
detectorType myDetectorType;
/** slsReceiverBase object */
slsReceiverImplementation *receiver{nullptr};
std::unique_ptr<slsReceiverImplementation> receiver{nullptr};
/** Function List */
int (slsReceiverTCPIPInterface::*flist[NUM_REC_FUNCTIONS])(sls::ServerInterface2& socket);

View File

@ -583,7 +583,7 @@ int slsReceiverTCPIPInterface::set_detector_type(sls::ServerInterface2 &socket){
}
if(ret == OK) {
if(receiver == nullptr){
receiver = new slsReceiverImplementation();
receiver = sls::make_unique<slsReceiverImplementation>();
}
myDetectorType = arg;
ret = receiver->setDetectorType(myDetectorType);