diff --git a/src/common/classes/auto.h b/src/common/classes/auto.h index 62fa4317dd..1bc0c32e08 100644 --- a/src/common/classes/auto.h +++ b/src/common/classes/auto.h @@ -331,7 +331,25 @@ public: } private: - F& clean; + F clean; +}; + +class CleanupFunction +{ + typedef void Func(); + +public: + CleanupFunction(Func* clFunc) + : clean(clFunc) + { } + + ~CleanupFunction() + { + clean(); + } + +private: + Func* clean; }; } //namespace Firebird diff --git a/src/common/classes/init.cpp b/src/common/classes/init.cpp index ce1ae272f1..89d71d65eb 100644 --- a/src/common/classes/init.cpp +++ b/src/common/classes/init.cpp @@ -145,7 +145,7 @@ namespace #ifndef DEBUG_INIT // This instance ensures dtors run when program exits - Firebird::Cleanup global(allClean); + Firebird::CleanupFunction global(allClean); #endif //DEBUG_INIT