memory leak fixed

This commit is contained in:
Matej Sekoranja
2011-03-04 09:25:32 +01:00
parent 49ab4968be
commit c12c5a8bf8
2 changed files with 15 additions and 6 deletions

View File

@@ -4,6 +4,9 @@
#include "serverChannelImpl.h"
// TODO remove
#include "responseHandlers.h"
namespace epics { namespace pvAccess {
@@ -74,6 +77,7 @@ Destroyable* ServerChannelImpl::getRequest(const pvAccessID id)
void ServerChannelImpl::destroy()
{
{
Lock guard(_mutex);
if (_destroyed) return;
@@ -82,9 +86,13 @@ void ServerChannelImpl::destroy()
// destroy all requests
destroyAllRequests();
// now thats ugly!!!
(static_cast<ServerChannelRequesterImpl*>(_channel->getChannelRequester()))->release();
// TODO make impl that does shares channels (and does ref counting)!!!
// try catch?
static_cast<ChannelImpl*>(_channel)->destroy();
_channel->destroy();
}
delete this;
}
void ServerChannelImpl::printInfo()