8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00

Make sure to release lock before delete

This commit is contained in:
alexpeshkoff 2007-07-25 13:16:31 +00:00
parent b4798666c2
commit 87da865e6a

View File

@ -859,7 +859,27 @@ void Collation::destroy()
tt->texttype_fn_destroy(tt);
delete tt;
delete existenceLock;
if (existenceLock)
{
thread_db thd_context, *tdbb;
// Establish a thread context.
JRD_set_thread_data(tdbb, thd_context);
tdbb->tdbb_database = existenceLock->lck_dbb;
tdbb->tdbb_attachment = existenceLock->lck_attachment;
tdbb->tdbb_quantum = QUANTUM;
tdbb->tdbb_request = NULL;
tdbb->tdbb_transaction = NULL;
Jrd::ContextPoolHolder context(tdbb, 0);
LCK_release(tdbb, existenceLock);
delete existenceLock;
// Restore the prior thread context
JRD_restore_thread_data();
}
}