From 266af4e84ac94fe5014d1f8b4272b2506ea6b62c Mon Sep 17 00:00:00 2001 From: asfernandes Date: Wed, 28 Mar 2007 02:16:52 +0000 Subject: [PATCH] Fixed crashes while restoring - reported privately by Alex --- src/jrd/exe.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/jrd/exe.cpp b/src/jrd/exe.cpp index fde050f540..2064f46b9d 100644 --- a/src/jrd/exe.cpp +++ b/src/jrd/exe.cpp @@ -3093,18 +3093,24 @@ static void release_blobs(thread_db* tdbb, jrd_req* request) const ULONG blob_temp_id = request->req_blobs.current(); if (transaction->tra_blobs.locate(blob_temp_id)) { BlobIndex *current = &transaction->tra_blobs.current(); - if (!current->bli_materialized) + if (current->bli_materialized) + { + request->req_blobs.fastRemove(); + current->bli_request = NULL; + } + else { // Blob was created by request, is accounted for internal needs, // but is not materialized. Get rid of it. BLB_cancel(tdbb, current->bli_blob_object); // Since the routine above modifies req_blobs // we need to reestablish accessor position - if (request->req_blobs.locate(Firebird::locGreat, blob_temp_id)) - continue; - else - break; } + + if (request->req_blobs.locate(Firebird::locGreat, blob_temp_id)) + continue; + else + break; } else { // Blob accounting inconsistent