@@ -251,7 +251,7 @@ void VerbAction::mergeTo(thread_db* tdbb, jrd_tra* transaction, VerbAction* next
251251 }
252252 }
253253
254- release (tdbb, transaction);
254+ discard ( transaction);
255255}
256256
257257void VerbAction::undo (thread_db* tdbb, jrd_tra* transaction, bool preserveLocks, VerbAction* preserveAction)
@@ -366,13 +366,11 @@ void VerbAction::undo(thread_db* tdbb, jrd_tra* transaction, bool preserveLocks,
366366 delete rpb.rpb_record ;
367367 }
368368
369- release (tdbb, transaction);
369+ discard ( transaction);
370370}
371371
372- void VerbAction::release (thread_db* tdbb, jrd_tra* transaction)
372+ void VerbAction::discard ( jrd_tra* transaction)
373373{
374- AutoSetRestore<FB_UINT64 > autoFrameId (&tdbb->tdbb_temp_frame_id , vct_temp_instance_id);
375-
376374 // Release resources used by this verb action
377375
378376 RecordBitmap::reset (vct_records);
@@ -439,23 +437,26 @@ void Savepoint::cleanupTempData()
439437 for (VerbAction* action = m_actions; action; action = action->vct_next )
440438 {
441439 if (action->vct_relation ->getPermanent ()->rel_flags & (REL_temp_tran | REL_temp_frame))
442- {
443- RecordBitmap::reset (action->vct_records );
440+ action->discard (m_transaction);
441+ }
442+ }
444443
445- if (action->vct_undo )
446- {
447- if (action->vct_undo ->getFirst ())
448- {
449- do
450- {
451- action->vct_undo ->current ().release (m_transaction);
452- } while (action->vct_undo ->getNext ());
453- }
454444
455- delete action->vct_undo ;
456- action->vct_undo = NULL ;
457- }
445+ void Savepoint::discardTempFrameActions (const jrd_rel* relation, FB_UINT64 tempInstanceId)
446+ {
447+ for (auto actionPtr = &m_actions; *actionPtr;)
448+ {
449+ const auto action = *actionPtr;
450+
451+ if (action->vct_relation == relation && action->vct_temp_instance_id == tempInstanceId)
452+ {
453+ action->discard (m_transaction);
454+ *actionPtr = action->vct_next ;
455+ action->vct_next = m_freeActions;
456+ m_freeActions = action;
458457 }
458+ else
459+ actionPtr = &action->vct_next ;
459460 }
460461}
461462
0 commit comments