Skip to content
Permalink
Browse files
Write error message ebfore aborting if not all memory is released
Also don't abort if global_status_var.global_memory_used != 0 on not
normal exit as then it's likely that not all memory is released.
  • Loading branch information
montywi committed Oct 31, 2017
1 parent 157f2b2 commit bd20fb8
Showing 1 changed file with 4 additions and 4 deletions.
@@ -2161,15 +2161,15 @@ static void mysqld_exit(int exit_code)
shutdown_performance_schema(); // we do it as late as possible
#endif
set_malloc_size_cb(NULL);
if (!opt_debugging && !my_disable_leak_check)
if (opt_endinfo && global_status_var.global_memory_used)
fprintf(stderr, "Warning: Memory not freed: %ld\n",
(long) global_status_var.global_memory_used);
if (!opt_debugging && !my_disable_leak_check && exit_code == 0)
{
DBUG_ASSERT(global_status_var.global_memory_used == 0);
}
cleanup_tls();
DBUG_LEAVE;
if (opt_endinfo && global_status_var.global_memory_used)
fprintf(stderr, "Warning: Memory not freed: %ld\n",
(long) global_status_var.global_memory_used);
sd_notify(0, "STATUS=MariaDB server is down");
exit(exit_code); /* purecov: inspected */
}

0 comments on commit bd20fb8

Please sign in to comment.