diff --git a/src/jrd/exe.cpp b/src/jrd/exe.cpp index 7b39f3a128..e25f1f6363 100644 --- a/src/jrd/exe.cpp +++ b/src/jrd/exe.cpp @@ -3319,7 +3319,7 @@ static void release_proc_save_points(jrd_req* request) ************************************** * * Functional description - * Release temporary blobs assigned by this request. + * Release savepoints used by this request. * **************************************/ Savepoint* sav_point = request->req_proc_sav_point; diff --git a/src/jrd/tra.h b/src/jrd/tra.h index 21ce34efa8..346f357d61 100644 --- a/src/jrd/tra.h +++ b/src/jrd/tra.h @@ -333,6 +333,12 @@ const int tra_precommitted = 5; // Transaction is precommitted class Savepoint : public pool_alloc { public: + ~Savepoint() + { + deleteActions(sav_verb_actions); + deleteActions(sav_verb_free); + } + VerbAction* sav_verb_actions; // verb action list VerbAction* sav_verb_free; // free verb actions USHORT sav_verb_count; // Active verb count @@ -340,6 +346,9 @@ public: Savepoint* sav_next; USHORT sav_flags; TEXT sav_name[MAX_SQL_IDENTIFIER_SIZE]; // Savepoint name + +private: + void deleteActions(VerbAction* list); }; // Savepoint block flags. @@ -487,12 +496,29 @@ typedef Firebird::BePlusTree UndoItemTre class VerbAction : public pool_alloc { public: + ~VerbAction() + { + delete vct_records; + delete vct_undo; + } + VerbAction* vct_next; // Next action within verb jrd_rel* vct_relation; // Relation involved RecordBitmap* vct_records; // Record involved UndoItemTree* vct_undo; // Data for undo records }; + +inline void Savepoint::deleteActions(VerbAction* list) +{ + while (list) + { + VerbAction* next = list->vct_next; + delete list; + list = next; + } +}; + } //namespace Jrd #endif // JRD_TRA_H