2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-02 23:15:20 +00:00

[#2034] atexit(mysql_library_end())

This commit is contained in:
Andrei Pavel
2021-09-10 18:24:08 +03:00
parent b87cbb2b25
commit cc2c293206
2 changed files with 7 additions and 3 deletions

View File

@@ -23,7 +23,9 @@ using namespace std;
namespace isc { namespace isc {
namespace db { namespace db {
bool MySqlHolder::atexit_ = []{atexit([]{mysql_library_end();});return true;}; int MySqlHolder::atexit_ = [] {
return atexit([] { mysql_library_end(); });
}();
/// @todo: Migrate this default value to src/bin/dhcpX/simple_parserX.cc /// @todo: Migrate this default value to src/bin/dhcpX/simple_parserX.cc
const int MYSQL_DEFAULT_CONNECTION_TIMEOUT = 5; // seconds const int MYSQL_DEFAULT_CONNECTION_TIMEOUT = 5; // seconds

View File

@@ -161,9 +161,11 @@ public:
} }
private: private:
static bool atexit_; ///< Flag to call atexit once. /// @brief Variable used for its static property to call atexit() once.
static int atexit_;
MYSQL* mysql_; ///< Initialization context /// @brief Initialization context
MYSQL* mysql_;
}; };
/// @brief Forward declaration to @ref MySqlConnection. /// @brief Forward declaration to @ref MySqlConnection.