From 9c1eda365565fdc20284d3e1b142944fbde1c027 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Sun, 15 May 2011 21:41:05 +0200 Subject: [PATCH] memory management --- pvAccessApp/server/serverChannelImpl.cpp | 5 +++++ pvAccessApp/server/serverChannelImpl.h | 2 +- pvAccessApp/server/serverContext.cpp | 7 ++++--- pvAccessApp/utils/hexDump.cpp | 1 + testApp/remote/testServer.cpp | 7 +++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pvAccessApp/server/serverChannelImpl.cpp b/pvAccessApp/server/serverChannelImpl.cpp index 2d82121..f5e1dc0 100644 --- a/pvAccessApp/server/serverChannelImpl.cpp +++ b/pvAccessApp/server/serverChannelImpl.cpp @@ -82,6 +82,11 @@ void ServerChannelImpl::destroy() _channel->destroy(); } +ServerChannelImpl::~ServerChannelImpl() +{ + destroy(); +} + void ServerChannelImpl::printInfo() { printInfo(stdout); diff --git a/pvAccessApp/server/serverChannelImpl.h b/pvAccessApp/server/serverChannelImpl.h index 626e821..a81ac38 100644 --- a/pvAccessApp/server/serverChannelImpl.h +++ b/pvAccessApp/server/serverChannelImpl.h @@ -29,7 +29,7 @@ public: /* * Destructor. */ - virtual ~ServerChannelImpl() {}; + virtual ~ServerChannelImpl(); /** * Get local channel. diff --git a/pvAccessApp/server/serverContext.cpp b/pvAccessApp/server/serverContext.cpp index 8165f92..57c1c79 100644 --- a/pvAccessApp/server/serverContext.cpp +++ b/pvAccessApp/server/serverContext.cpp @@ -54,6 +54,7 @@ ServerContextImpl::shared_pointer ServerContextImpl::create() ServerContextImpl::~ServerContextImpl() { + dispose(); } const Version& ServerContextImpl::getVersion() @@ -529,19 +530,19 @@ TransportRegistry::shared_pointer ServerContextImpl::getTransportRegistry() Channel::shared_pointer ServerContextImpl::getChannel(pvAccessID id) { - //TODO, not used + // not used return Channel::shared_pointer(); } Transport::shared_pointer ServerContextImpl::getSearchTransport() { - //TODO, not used + // not used return Transport::shared_pointer(); } void ServerContextImpl::beaconAnomalyNotify() { - // noop + // not used } diff --git a/pvAccessApp/utils/hexDump.cpp b/pvAccessApp/utils/hexDump.cpp index 088a9c5..9c96cd5 100644 --- a/pvAccessApp/utils/hexDump.cpp +++ b/pvAccessApp/utils/hexDump.cpp @@ -67,6 +67,7 @@ namespace epics { //additional whitespaces after four bytes pad += (delta_bytes/4); + pad++; for(int i = 0; i(shared_from_this()); + ChannelProcess::shared_pointer thisPtr; // we return null = static_pointer_cast(shared_from_this()); PVField* field = pvStructure->getSubField(String("value")); if (field == 0) { @@ -47,7 +46,7 @@ class MockChannelProcess : { Status notAScalarStatus(Status::STATUSTYPE_ERROR, "'value' field not scalar type"); m_channelProcessRequester->channelProcessConnect(notAScalarStatus, thisPtr); - // NOTE client must destroy this instance…. + // NOTE client must destroy this instance... // do not access any fields and return ASAP return; } @@ -1099,7 +1098,7 @@ void testServer() ctx->printInfo(); - ctx->run(10); + ctx->run(100); ctx->destroy();