From a460334c6751a52262e6579ec129b379c9d754d7 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Sat, 5 Nov 2011 20:51:46 +0000 Subject: [PATCH] Fixed CORE-3650 - Recreation of collation leads to FB "death". --- src/jrd/intl.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/jrd/intl.cpp b/src/jrd/intl.cpp index d311fa3a22..4acc8ce80c 100644 --- a/src/jrd/intl.cpp +++ b/src/jrd/intl.cpp @@ -473,11 +473,13 @@ void CharSetContainer::unloadCollation(thread_db* tdbb, USHORT tt_id) } fb_assert(charset_collations[id]->existenceLock); - LCK_convert(tdbb, charset_collations[id]->existenceLock, LCK_EX, LCK_WAIT); - charset_collations[id]->obsolete = true; - - LCK_release(tdbb, charset_collations[id]->existenceLock); + if (!charset_collations[id]->obsolete) + { + LCK_convert(tdbb, charset_collations[id]->existenceLock, LCK_EX, LCK_WAIT); + charset_collations[id]->obsolete = true; + LCK_release(tdbb, charset_collations[id]->existenceLock); + } } else { @@ -1394,8 +1396,7 @@ static int blocking_ast_collation(void* ast_object) AsyncContextHolder tdbb(dbb, att); tt->obsolete = true; - if (!tt->useCount) - LCK_release(tdbb, tt->existenceLock); + LCK_release(tdbb, tt->existenceLock); } catch (const Firebird::Exception&) {} // no-op