diff --git a/src/common/classes/init.h b/src/common/classes/init.h index cc2d7ba6e8..8334826cc3 100644 --- a/src/common/classes/init.h +++ b/src/common/classes/init.h @@ -125,7 +125,7 @@ public: // This means - for objects with ctors/dtors that want to be global, // provide ctor with MemoryPool& parameter. Even if it is ignored! instance = FB_NEW(*getDefaultMemoryPool()) T(*getDefaultMemoryPool()); - // Put ourself into linked list for cleanup. + // Put ourselves into linked list for cleanup. // Allocated pointer is saved by InstanceList::constructor. new InstanceControl::InstanceLink(this); } @@ -156,9 +156,11 @@ public: : flag(false) { } void init() { - if (!flag) { + if (!flag) + { MutexLockGuard guard(*StaticMutex::mutex); - if (!flag) { + if (!flag) + { C::init(); flag = true; } @@ -166,9 +168,11 @@ public: } void cleanup() { - if (flag) { + if (flag) + { MutexLockGuard guard(*StaticMutex::mutex); - if (flag) { + if (flag) + { C::cleanup(); flag = false; } @@ -187,17 +191,19 @@ private: public: InitInstance() - : instance(0), flag(false) + : instance(0), flag(false) { } T& operator()() { - if (!flag) { + if (!flag) + { MutexLockGuard guard(*StaticMutex::mutex); - if (!flag) { + if (!flag) + { instance = FB_NEW(*getDefaultMemoryPool()) T(*getDefaultMemoryPool()); flag = true; - // Put ourself into linked list for cleanup. + // Put ourselves into linked list for cleanup. // Allocated pointer is saved by InstanceList::constructor. new InstanceControl::InstanceLink(this); } diff --git a/src/remote/interface.cpp b/src/remote/interface.cpp index b0eec66ba8..ebb4a1fa6a 100644 --- a/src/remote/interface.cpp +++ b/src/remote/interface.cpp @@ -5563,7 +5563,7 @@ namespace class InitList : public HalfStaticArray { public: - InitList(MemoryPool& p) + explicit InitList(MemoryPool& p) : HalfStaticArray(p) { // this code will be replaced with known plugins scan diff --git a/src/remote/server.cpp b/src/remote/server.cpp index 759bc020e4..a50d1ff34d 100644 --- a/src/remote/server.cpp +++ b/src/remote/server.cpp @@ -219,7 +219,7 @@ GlobalPtr remoteFailedLogins; class InitList : public HalfStaticArray { public: - InitList(MemoryPool& p) + explicit InitList(MemoryPool& p) : HalfStaticArray(p) { PathName authMethod(Config::getAuthMethod());