aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/zmq-ctrl/cpp/OdrModCtrl.cpp1
-rw-r--r--src/RemoteControl.cpp9
2 files changed, 5 insertions, 5 deletions
diff --git a/doc/zmq-ctrl/cpp/OdrModCtrl.cpp b/doc/zmq-ctrl/cpp/OdrModCtrl.cpp
index 731a9af..416ffcd 100644
--- a/doc/zmq-ctrl/cpp/OdrModCtrl.cpp
+++ b/doc/zmq-ctrl/cpp/OdrModCtrl.cpp
@@ -51,6 +51,7 @@ COdrModCtrl::COdrModCtrl(zmq::context_t *pContext, std::string odrEndpoint,
m_pContext = pContext;
m_odrEndpoint = odrEndpoint;
m_timeoutMs = (uint32_t) timeoutMs;
+ m_pReqSocket = NULL;
}
COdrModCtrl::~COdrModCtrl()
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp
index 666f891..21a6c81 100644
--- a/src/RemoteControl.cpp
+++ b/src/RemoteControl.cpp
@@ -310,7 +310,7 @@ void RemoteControllerZmq::process()
{
// create zmq reply socket for receiving ctrl parameters
zmq::socket_t repSocket(m_zmqContext, ZMQ_REP);
- std::cout << "Starting zmq remote control thread" << std::endl;
+ std::cerr << "Starting zmq remote control thread" << std::endl;
try
{
// connect the socket
@@ -344,10 +344,9 @@ void RemoteControllerZmq::process()
try
{
std::string value = get_param_(module, parameter);
- zmq::message_t *pMsg = new zmq::message_t(value.size());
- memcpy ((void*) pMsg->data(), value.data(), value.size());
- repSocket.send(*pMsg, 0);
- delete pMsg;
+ zmq::message_t msg(value.size());
+ memcpy ((void*) msg.data(), value.data(), value.size());
+ repSocket.send(&msg, 0);
}
catch (ParameterError &err)
{