mirror of
https://github.com/MariaDB/server.git
synced 2025-08-21 16:03:24 +03:00
Applying InnoDB Plugin 1.0.6 snapshot,part 1. Fixes BUG#45992 and BUG#46656
Detailed revision comments: r6130 | marko | 2009-11-02 11:42:56 +0200 (Mon, 02 Nov 2009) | 9 lines branches/zip: Free all resources at shutdown. Set pointers to NULL, so that Valgrind will not complain about freed data structures that are reachable via pointers. This addresses Bug #45992 and Bug #46656. This patch is mostly based on changes copied from branches/embedded-1.0, mainly c5432, c3439, c3134, c2994, c2978, but also some other code was copied. Some added cleanup code is specific to MySQL/InnoDB. rb://199 approved by Sunny Bains
This commit is contained in:
@@ -31,14 +31,6 @@ Created 6/25/1996 Heikki Tuuri
|
||||
|
||||
#include "trx0trx.h"
|
||||
|
||||
/*********************************************************************//**
|
||||
Closes a session, freeing the memory occupied by it. */
|
||||
static
|
||||
void
|
||||
sess_close(
|
||||
/*=======*/
|
||||
sess_t* sess); /*!< in, own: session object */
|
||||
|
||||
/*********************************************************************//**
|
||||
Opens a session.
|
||||
@return own: session object */
|
||||
@@ -64,35 +56,16 @@ sess_open(void)
|
||||
|
||||
/*********************************************************************//**
|
||||
Closes a session, freeing the memory occupied by it. */
|
||||
static
|
||||
UNIV_INTERN
|
||||
void
|
||||
sess_close(
|
||||
/*=======*/
|
||||
sess_t* sess) /*!< in, own: session object */
|
||||
{
|
||||
ut_ad(mutex_own(&kernel_mutex));
|
||||
ut_ad(sess->trx == NULL);
|
||||
ut_ad(!mutex_own(&kernel_mutex));
|
||||
|
||||
ut_a(UT_LIST_GET_LEN(sess->graphs) == 0);
|
||||
|
||||
trx_free_for_background(sess->trx);
|
||||
mem_free(sess);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Closes a session, freeing the memory occupied by it, if it is in a state
|
||||
where it should be closed.
|
||||
@return TRUE if closed */
|
||||
UNIV_INTERN
|
||||
ibool
|
||||
sess_try_close(
|
||||
/*===========*/
|
||||
sess_t* sess) /*!< in, own: session object */
|
||||
{
|
||||
ut_ad(mutex_own(&kernel_mutex));
|
||||
|
||||
if (UT_LIST_GET_LEN(sess->graphs) == 0) {
|
||||
sess_close(sess);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user