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

View file

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