mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 00:03:03 +01:00
Backport changes from HEAD necessary for CORE-1658
This commit is contained in:
parent
4d18b2ec67
commit
056f0ff422
@ -230,6 +230,27 @@ namespace {
|
|||||||
#define TEXT SCHAR
|
#define TEXT SCHAR
|
||||||
#endif // WIN_NT
|
#endif // WIN_NT
|
||||||
|
|
||||||
|
|
||||||
|
Jrd::Database::~Database()
|
||||||
|
{
|
||||||
|
delete dbb_sys_trans;
|
||||||
|
destroyIntlObjects();
|
||||||
|
|
||||||
|
pool_ptr* itr = dbb_pools.begin();
|
||||||
|
while (itr != dbb_pools.end())
|
||||||
|
{
|
||||||
|
if (*itr && *itr == dbb_bufferpool)
|
||||||
|
dbb_bufferpool = 0;
|
||||||
|
if (*itr && *itr != dbb_permanent)
|
||||||
|
itr = JrdMemoryPool::deletePool(*itr);
|
||||||
|
else
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
if (dbb_bufferpool)
|
||||||
|
JrdMemoryPool::deletePool(dbb_bufferpool);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Jrd::Trigger::compile(thread_db* tdbb)
|
void Jrd::Trigger::compile(thread_db* tdbb)
|
||||||
{
|
{
|
||||||
if (!request /*&& !compile_in_progress*/)
|
if (!request /*&& !compile_in_progress*/)
|
||||||
|
@ -334,23 +334,7 @@ private:
|
|||||||
dbb_pools.resize(1);
|
dbb_pools.resize(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
~Database()
|
~Database();
|
||||||
{
|
|
||||||
destroyIntlObjects();
|
|
||||||
|
|
||||||
pool_ptr* itr = dbb_pools.begin();
|
|
||||||
while (itr != dbb_pools.end())
|
|
||||||
{
|
|
||||||
if (*itr && *itr == dbb_bufferpool)
|
|
||||||
dbb_bufferpool = 0;
|
|
||||||
if (*itr && *itr != dbb_permanent)
|
|
||||||
itr = JrdMemoryPool::deletePool(*itr);
|
|
||||||
else
|
|
||||||
++itr;
|
|
||||||
}
|
|
||||||
if (dbb_bufferpool)
|
|
||||||
JrdMemoryPool::deletePool(dbb_bufferpool);
|
|
||||||
}
|
|
||||||
|
|
||||||
// temporal measure to avoid unstable state of lock file -
|
// temporal measure to avoid unstable state of lock file -
|
||||||
// this is anyway called in ~Database(), and in theory should be private
|
// this is anyway called in ~Database(), and in theory should be private
|
||||||
|
@ -1044,6 +1044,7 @@ void TRA_release_transaction(thread_db* tdbb, jrd_tra* transaction)
|
|||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
SET_TDBB(tdbb);
|
SET_TDBB(tdbb);
|
||||||
|
Database* dbb = tdbb->getDatabase();
|
||||||
|
|
||||||
if (transaction->tra_blobs.getFirst())
|
if (transaction->tra_blobs.getFirst())
|
||||||
while (true)
|
while (true)
|
||||||
@ -1152,11 +1153,7 @@ void TRA_release_transaction(thread_db* tdbb, jrd_tra* transaction)
|
|||||||
|
|
||||||
delete transaction->tra_db_snapshot;
|
delete transaction->tra_db_snapshot;
|
||||||
|
|
||||||
// Release the transaction pool.
|
jrd_tra::destroy(dbb, transaction);
|
||||||
|
|
||||||
JrdMemoryPool* tra_pool = transaction->tra_pool;
|
|
||||||
if (tra_pool)
|
|
||||||
JrdMemoryPool::deletePool(tra_pool);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,6 +111,18 @@ public:
|
|||||||
delete tra_blob_space;
|
delete tra_blob_space;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void destroy(Database* const dbb, jrd_tra* const transaction)
|
||||||
|
{
|
||||||
|
if (transaction)
|
||||||
|
{
|
||||||
|
JrdMemoryPool* const pool = transaction->tra_pool;
|
||||||
|
delete transaction;
|
||||||
|
|
||||||
|
if (pool)
|
||||||
|
JrdMemoryPool::deletePool(pool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Attachment* tra_attachment; /* database attachment */
|
Attachment* tra_attachment; /* database attachment */
|
||||||
SLONG tra_number; /* transaction number */
|
SLONG tra_number; /* transaction number */
|
||||||
SLONG tra_top; /* highest transaction in snapshot */
|
SLONG tra_top; /* highest transaction in snapshot */
|
||||||
|
Loading…
Reference in New Issue
Block a user