Fix to bug #510, http://bugs.skysql.com/show_bug.cgi?id=510, made every MaxScale thread to call mysql_thread_init() before entering poll_waitevents. Also main thread does this before starting services. Removed all calls to mysql_thread_init() and to mysql_thread_end() from elsewhere than from poll.c:poll_waitevents and from gateway.c:main
skygw_utils.cc: replace_literal: fixed memory leak
This commit is contained in:
@ -187,14 +187,6 @@ getUsers(SERVICE *service, struct users *users)
|
||||
if (service_user == NULL || service_passwd == NULL)
|
||||
return -1;
|
||||
|
||||
/** multi-thread environment requires that thread init succeeds. */
|
||||
if (mysql_thread_init()) {
|
||||
LOGIF(LE, (skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
"Error : mysql_thread_init failed.")));
|
||||
return -1;
|
||||
}
|
||||
|
||||
con = mysql_init(NULL);
|
||||
|
||||
if (con == NULL) {
|
||||
@ -391,7 +383,6 @@ getUsers(SERVICE *service, struct users *users)
|
||||
|
||||
mysql_free_result(result);
|
||||
mysql_close(con);
|
||||
mysql_thread_end();
|
||||
|
||||
return total_users;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user