fix mem issue with outgoing transactions

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7430 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2014-07-05 12:29:40 +00:00
parent 1c03fb0344
commit 30681ed205
2 changed files with 14 additions and 8 deletions

View File

@ -743,7 +743,9 @@ void RsGxsNetService::recvNxsItemQueue(){
std::cerr << "handlingTransaction, transN" << ni->transactionNumber << std::endl;
#endif
if(handleTransaction(ni))
if(!handleTransaction(ni))
delete ni;
continue;
}
@ -893,7 +895,7 @@ bool RsGxsNetService::locked_processTransac(RsNxsTransac* item)
// note state as receiving, commencement item
// is sent on next run() loop
tr->mFlag = NxsTransaction::FLAG_STATE_STARTING;
return;
// commencement item for outgoing transaction
}else if(item->transactFlag & RsNxsTransac::FLAG_BEGIN_P2){
@ -907,7 +909,8 @@ bool RsGxsNetService::locked_processTransac(RsNxsTransac* item)
TransactionIdMap& transMap = mTransactions[mOwnId];
NxsTransaction* tr = transMap[transN];
tr->mFlag = NxsTransaction::FLAG_STATE_SENDING;
delete item;
return true;
// end transac item for outgoing transaction
}else if(item->transactFlag & RsNxsTransac::FLAG_END_SUCCESS){
@ -921,10 +924,12 @@ bool RsGxsNetService::locked_processTransac(RsNxsTransac* item)
TransactionIdMap& transMap = mTransactions[mOwnId];
NxsTransaction* tr = transMap[transN];
tr->mFlag = NxsTransaction::FLAG_STATE_COMPLETED;
}
delete item;
return true;
}
else
return false;
}
void RsGxsNetService::run(){

View File

@ -183,6 +183,7 @@ private:
/*!
* Process a transaction item, assumes a general lock
* @param item the transaction item to process
* @return false ownership of item left with callee
*/
bool locked_processTransac(RsNxsTransac* item);