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

Fixed crash when run test bugs.core_5329 in Classic mode using debug build.

This commit is contained in:
hvlad 2018-07-11 01:09:50 +03:00
parent 9b0ac5c52a
commit 90e2b3035c
2 changed files with 39 additions and 0 deletions

View File

@ -219,6 +219,8 @@ private:
DsqlBatch* batch;
Firebird::RefPtr<JStatement> statement;
Firebird::RefPtr<Firebird::IMessageMetadata> m_meta;
void freeEngineData(Firebird::CheckStatusWrapper* status);
};
class JStatement FB_FINAL :

View File

@ -5583,16 +5583,53 @@ int JBatch::release()
if (batch)
{
/*
Attachment* att = getAttachment()->getHandle();
if (att)
att->deregisterBatch(this);
delete batch;
*/
LocalStatus status;
CheckStatusWrapper statusWrapper(&status);
freeEngineData(&statusWrapper);
}
delete this;
return 0;
}
void JBatch::freeEngineData(Firebird::CheckStatusWrapper* user_status)
{
try
{
EngineContextHolder tdbb(user_status, this, FB_FUNCTION);
check_database(tdbb);
try
{
Attachment* att = getAttachment()->getHandle();
if (att)
att->deregisterBatch(this);
delete batch;
}
catch (const Exception& ex)
{
transliterateException(tdbb, ex, user_status, FB_FUNCTION);
return;
}
}
catch (const Exception& ex)
{
ex.stuffException(user_status);
return;
}
successful_completion(user_status);
}
void JBatch::add(CheckStatusWrapper* status, unsigned count, const void* inBuffer)
{