Skip to content

Commit 3218eda

Browse files
committed
Bug #91820: Fix static linking destruction order
1 parent 39f6ffe commit 3218eda

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

driver/mysql_driver.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ namespace mysql
7070
{
7171

7272
static const ::sql::SQLString emptyStr("");
73-
/* Mapping by client name is probably not enough here */
74-
static std::map< sql::SQLString, boost::shared_ptr<MySQL_Driver> > driver;
73+
7574

7675
CPPCONN_PUBLIC_FUNC sql::mysql::MySQL_Driver * get_driver_instance()
7776
{
@@ -83,6 +82,9 @@ CPPCONN_PUBLIC_FUNC sql::mysql::MySQL_Driver * get_driver_instance_by_name(const
8382
{
8483
::sql::SQLString dummy(clientlib);
8584

85+
/* Mapping by client name is probably not enough here */
86+
static std::map< sql::SQLString, boost::shared_ptr<MySQL_Driver> > driver;
87+
8688
std::map< sql::SQLString, boost::shared_ptr< MySQL_Driver > >::const_iterator cit;
8789

8890
if ((cit = driver.find(dummy)) != driver.end()) {

0 commit comments

Comments
 (0)