additional patches for memory leaks (see mantis 340)

This commit is contained in:
Jeff Hill
2009-07-07 23:09:21 +00:00
parent 6a2044cb01
commit f7bfbf73f8
2 changed files with 14 additions and 20 deletions

View File

@@ -426,7 +426,6 @@ caStatus casStrmClient::readAction ( epicsGuard < casClientMutex > & guard )
const caHdrLargeArray * mp = this->ctx.getMsg();
caStatus status;
casChannelI * pChan;
const gdd * pDesc;
status = this->verifyRequest ( pChan );
if ( status != ECA_NORMAL ) {
@@ -458,9 +457,11 @@ caStatus casStrmClient::readAction ( epicsGuard < casClientMutex > & guard )
status, "read access denied" );
}
const gdd * pDesc = 0;
status = this->read ( pDesc );
if ( status == S_casApp_success ) {
status = this->readResponse ( guard, pChan, *mp, *pDesc, S_cas_success );
pDesc->unreference ();
}
else if ( status == S_casApp_asyncCompletion ) {
status = S_cas_success;
@@ -473,10 +474,6 @@ caStatus casStrmClient::readAction ( epicsGuard < casClientMutex > & guard )
pChan->getCID(), status, ECA_GETFAIL );
}
if ( pDesc ) {
pDesc->unreference ();
}
return status;
}
@@ -544,7 +541,6 @@ caStatus casStrmClient::readNotifyAction ( epicsGuard < casClientMutex > & guard
{
const caHdrLargeArray * mp = this->ctx.getMsg();
casChannelI * pChan;
const gdd * pDesc;
int status;
status = this->verifyRequest ( pChan );
@@ -561,9 +557,11 @@ caStatus casStrmClient::readNotifyAction ( epicsGuard < casClientMutex > & guard
return this->readNotifyFailureResponse ( guard, *mp, ECA_NORDACCESS );
}
const gdd * pDesc = 0;
status = this->read ( pDesc );
if ( status == S_casApp_success ) {
status = this->readNotifyResponse ( guard, pChan, *mp, *pDesc, status );
pDesc->unreference ();
}
else if ( status == S_casApp_asyncCompletion ) {
status = S_cas_success;
@@ -572,13 +570,9 @@ caStatus casStrmClient::readNotifyAction ( epicsGuard < casClientMutex > & guard
pChan->getPVI().addItemToIOBLockedList ( *this );
}
else {
status = this->readNotifyResponse ( guard, pChan, *mp, *pDesc, status );
status = this->readNotifyFailureResponse ( guard, *mp, ECA_GETFAIL );
}
if ( pDesc ) {
pDesc->unreference ();
}
return status;
}
@@ -1634,12 +1628,17 @@ caStatus casStrmClient::eventAddAction (
// to postpone asynchronous IO we can safely restart this
// request later.
//
const gdd * pDD;
const gdd * pDD = 0;
status = this->read ( pDD );
//
// always send immediate monitor response at event add
//
if ( status == S_casApp_asyncCompletion ) {
if ( status == S_cas_success ) {
status = this->monitorResponse ( guard, *pciu,
*mp, *pDD, status );
pDD->unreference ();
}
else if ( status == S_casApp_asyncCompletion ) {
status = S_cas_success;
}
else if ( status == S_casApp_postponeAsyncIO ) {
@@ -1649,8 +1648,7 @@ caStatus casStrmClient::eventAddAction (
pciu->getPVI().addItemToIOBLockedList ( *this );
}
else {
status = this->monitorResponse ( guard, *pciu,
*mp, *pDD, status );
status = this->monitorFailureResponse ( guard, *mp, ECA_GETFAIL );
}
if ( status == S_cas_success ) {
@@ -1660,10 +1658,6 @@ caStatus casStrmClient::eventAddAction (
pciu->installMonitor ( mon );
}
if ( pDD ) {
pDD->unreference ();
}
return status;
}

View File

@@ -123,7 +123,7 @@ private:
const caHdrLargeArray &, const caStatus status );
caStatus monitorResponse ( epicsGuard < casClientMutex > &,
casChannelI & chan, const caHdrLargeArray & msg,
const gdd & desc, const caStatus status );
const gdd &, const caStatus status );
caStatus enumPostponedCreateChanResponse ( epicsGuard < casClientMutex > &,
casChannelI & chan, const caHdrLargeArray & hdr );
caStatus privateCreateChanResponse ( epicsGuard < casClientMutex > &,