mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:03:04 +01:00
Fixed CORE-2173: Server crash after ubnormal disconnect with open ExecuteStatement
This commit is contained in:
parent
30af81398b
commit
4f480137cf
@ -89,6 +89,7 @@ void startCallback(thread_db* tdbb)
|
||||
#if (defined DEV_BUILD && !defined MULTI_THREAD)
|
||||
tdbb->getDatabase()->dbb_flags |= DBB_exec_statement;
|
||||
#endif
|
||||
if (tdbb->getTransaction())
|
||||
tdbb->getTransaction()->tra_callback_count++;
|
||||
THREAD_EXIT();
|
||||
}
|
||||
@ -99,6 +100,7 @@ void finishCallback(thread_db* tdbb)
|
||||
#if (defined DEV_BUILD && !defined MULTI_THREAD)
|
||||
tdbb->getDatabase()->dbb_flags &= ~DBB_exec_statement;
|
||||
#endif
|
||||
if (tdbb->getTransaction())
|
||||
tdbb->getTransaction()->tra_callback_count--;
|
||||
}
|
||||
|
||||
@ -294,15 +296,21 @@ void ExecuteStatement::Close(thread_db* tdbb)
|
||||
|
||||
Statement = 0;
|
||||
}
|
||||
|
||||
// if transaction is already missing, it's pool is also deleted,
|
||||
// i.e. impossible and no use deleting something from it
|
||||
if (tdbb->getTransaction()) {
|
||||
char* p = reinterpret_cast<char*>(Sqlda);
|
||||
delete[] p;
|
||||
delete[] Buffer;
|
||||
}
|
||||
Sqlda = 0;
|
||||
Buffer = 0;
|
||||
|
||||
if (Transaction) {
|
||||
delete YValve::translate<YValve::Transaction>(&Transaction);
|
||||
Transaction = 0;
|
||||
}
|
||||
delete[] Buffer;
|
||||
Buffer = 0;
|
||||
}
|
||||
|
||||
XSQLDA* ExecuteStatement::MakeSqlda(thread_db* tdbb, short n)
|
||||
|
Loading…
Reference in New Issue
Block a user