summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-01-27 16:46:26 +0200
committerMonty <monty@mariadb.org>2017-01-27 16:46:26 +0200
commit5c9baf54e7af994391aa0510f666b364ff2e657b (patch)
treeb85b9f0cf42ab6eb3e11f1963f542e90925365a4 /include
parent46eef1ede2ddfceaa056a71ea52ecacdde2bc44e (diff)
downloadmariadb-git-5c9baf54e7af994391aa0510f666b364ff2e657b.tar.gz
Fix for memory leak in applications, like QT,that calls
my_thread_global_init() + my_thrad_global_end() repeatadily. This caused THR_KEY_mysys to be allocated multiple times. Deletion of THR_KEY_mysys was originally in my_thread_global_end() but was moved to my_end() as DBUG uses THR_KEY_mysys and DBUG is released after my_thread_global_end() is called. Releasing DBUG before my_thread_global_end() and move THR_KEY_mysys back into my_thread_global_end() could be a solution, but as safe_mutex and other things called by my_thread_global_end is using DBUG it may not be completely safe. To solve this, I used the simple solution to add a marker that THR_KEY_mysys is created and not re-create it in my_thread_global_init if it already exists.
Diffstat (limited to 'include')
-rw-r--r--include/my_sys.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 5392a94d27e..967228790ae 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -227,7 +227,7 @@ extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern ulong my_file_total_opened;
extern ulong my_sync_count;
extern uint mysys_usage_id;
-extern my_bool my_init_done;
+extern my_bool my_init_done, my_thr_key_mysys_exists;
extern my_bool my_assert_on_error;
extern myf my_global_flags; /* Set to MY_WME for more error messages */
/* Point to current my_message() */