From 81c1e2e60446b5044abed4434299803b286af925 Mon Sep 17 00:00:00 2001 From: hvlad Date: Tue, 24 Jun 2008 12:02:29 +0000 Subject: [PATCH] Correct error in my previous commit. --- src/jrd/jrd.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 46cc6af16e..71b793e537 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -5793,21 +5793,28 @@ static ISC_STATUS unwindAttach(const Firebird::Exception& ex, Attachment* attachment, Database* dbb) { - ThreadStatusGuard temp_status(tdbb); - - dbb->dbb_flags &= ~DBB_being_opened; - - if (attachment) + try { - release_attachment(tdbb, attachment); - } + ThreadStatusGuard temp_status(tdbb); + + dbb->dbb_flags &= ~DBB_being_opened; - if (dbb->checkHandle()) - { - if (!dbb->dbb_attachments) + if (attachment) { - shutdown_database(dbb, true); + release_attachment(tdbb, attachment); } + + if (dbb->checkHandle()) + { + if (!dbb->dbb_attachments) + { + shutdown_database(dbb, true); + } + } + } + catch (const Firebird::Exception&) + { + // no-op } Firebird::stuff_exception(userStatus, ex);