mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 06:43:03 +01:00
Fixed transactions leak caused by my recent commit
This commit is contained in:
parent
0cace38015
commit
dcb2f81695
@ -4311,13 +4311,21 @@ ITransaction* YStatement::execute(IStatus* status, ITransaction* transaction,
|
|||||||
ITransaction* newTrans = entry.next()->execute(status, trans, inMetadata, inBuffer,
|
ITransaction* newTrans = entry.next()->execute(status, trans, inMetadata, inBuffer,
|
||||||
outMetadata, outBuffer);
|
outMetadata, outBuffer);
|
||||||
|
|
||||||
if (newTrans)
|
|
||||||
{
|
|
||||||
if (newTrans == trans)
|
if (newTrans == trans)
|
||||||
|
{
|
||||||
newTrans = transaction;
|
newTrans = transaction;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (transaction)
|
||||||
|
{
|
||||||
|
if (trans)
|
||||||
|
trans->addRef(); // Will be decremented by release on next line
|
||||||
|
transaction->release();
|
||||||
transaction = NULL; // Get ready for correct return in OOM case
|
transaction = NULL; // Get ready for correct return in OOM case
|
||||||
|
}
|
||||||
|
if (newTrans)
|
||||||
|
{
|
||||||
newTrans = new YTransaction(attachment, newTrans);
|
newTrans = new YTransaction(attachment, newTrans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5201,13 +5209,21 @@ ITransaction* YAttachment::execute(IStatus* status, ITransaction* transaction,
|
|||||||
ITransaction* newTrans = entry.next()->execute(status, trans, length, string, dialect,
|
ITransaction* newTrans = entry.next()->execute(status, trans, length, string, dialect,
|
||||||
inMetadata, inBuffer, outMetadata, outBuffer);
|
inMetadata, inBuffer, outMetadata, outBuffer);
|
||||||
|
|
||||||
if (newTrans)
|
|
||||||
{
|
|
||||||
if (newTrans == trans)
|
if (newTrans == trans)
|
||||||
|
{
|
||||||
newTrans = transaction;
|
newTrans = transaction;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (transaction)
|
||||||
|
{
|
||||||
|
if (trans)
|
||||||
|
trans->addRef(); // Will be decremented by release on next line
|
||||||
|
transaction->release();
|
||||||
transaction = NULL; // Get ready for correct return in OOM case
|
transaction = NULL; // Get ready for correct return in OOM case
|
||||||
|
}
|
||||||
|
if (newTrans)
|
||||||
|
{
|
||||||
newTrans = new YTransaction(this, newTrans);
|
newTrans = new YTransaction(this, newTrans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user