mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-27 11:00:37 -05:00
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:
parent
1c03fb0344
commit
30681ed205
2 changed files with 14 additions and 8 deletions
|
|
@ -743,8 +743,10 @@ 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))
|
||||||
continue ;
|
delete ni;
|
||||||
|
|
||||||
|
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,9 +924,11 @@ 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(){
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue