diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 5ef7a230b3c..d886c1ed8f5 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2131,20 +2131,27 @@ buf_pool_init(
 /********************************************************************//**
 Frees the buffer pool at shutdown.  This must not be invoked before
 freeing all mutexes. */
 void
 buf_pool_free(
 /*==========*/
 	ulint	n_instances)	/*!< in: numbere of instances to free */
 {
 	for (ulint i = 0; i < n_instances; i++) {
 		buf_pool_free_instance(buf_pool_from_array(i));
+
+                // In the event of a shutdown, leave the loop prematurely,
+                // to speed up the shutdown time.
+                if (srv_shutdown_state != SRV_SHUTDOWN_NONE)
+                {
+                        break;
+                }
 	}
 
 	UT_DELETE(buf_chunk_map_reg);
 	buf_chunk_map_reg = buf_chunk_map_ref = NULL;
 
 	ut_free(buf_pool_ptr);
 	buf_pool_ptr = NULL;
 }
 
 /** Reallocate a control block.
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 947fce1ae3a..427f49c3e85 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1134,20 +1134,27 @@ dict_make_room_in_cache(
 
 	        prev_table = UT_LIST_GET_PREV(table_LRU, table);
 
 		if (dict_table_can_be_evicted(table)) {
 			ut_ad(!table->fts);
 			dict_sys.remove(table, true);
 
 			++n_evicted;
 		}
 
+                // In the event of a shutdown, leave the loop prematurely,
+                // to speed up the shutdown time.
+                if(srv_shutdown_state != SRV_SHUTDOWN_NONE)
+                {
+                        break;
+                }
+
 		table = prev_table;
 	}
 
 	return(n_evicted);
 }
 
 /** Looks for an index with the given id given a table instance.
 @param[in]	table	table instance
 @param[in]	id	index id
 @return index or NULL */
@@ -5885,20 +5892,25 @@ void dict_sys_t::close()
   {
     dict_table_t* table = static_cast<dict_table_t*>(HASH_GET_FIRST(table_hash,
 								    i));
 
     while (table)
     {
       dict_table_t* prev_table = table;
       table = static_cast<dict_table_t*>(HASH_GET_NEXT(name_hash, prev_table));
       dict_sys.remove(prev_table);
     }
+
+    if(srv_shutdown_state != SRV_SHUTDOWN_NONE)
+    {
+      break;
+    }
   }
 
   hash_table_free(table_hash);
 
   /* table_id_hash contains the same elements as in table_hash,
   therefore we don't delete the individual elements. */
   hash_table_free(table_id_hash);
 
   /* No temporary tables should exist at this point. */
   hash_table_free(temp_id_hash);
diff --git a/storage/innobase/include/ut0rbt.h b/storage/innobase/include/ut0rbt.h
index 38071165c3f..acccbd2b32c 100644
--- a/storage/innobase/include/ut0rbt.h
+++ b/storage/innobase/include/ut0rbt.h
@@ -27,21 +27,27 @@ Created 2007-03-20 Sunny Bains
 
 #if !defined(IB_RBT_TESTING)
 #include "ut0mem.h"
 #else
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 
 #define	ut_malloc	malloc
-#define	ut_free		free
+
+// The memory is only released during operation.
+// In the event of a shutdown, no more memory is released,
+// to speed up the shutdown time.
+extern enum srv_shutdown_t srv_shutdown_state;
+#define ut_free if(srv_shutdown_state == SRV_SHUTDOWN_NONE) free
+
 #define	ulint		unsigned long
 #define	ut_a(c)		assert(c)
 #define ut_error	assert(0)
 #define	ibool		unsigned int
 #define	TRUE		1
 #define	FALSE		0
 #endif
 
 struct ib_rbt_node_t;
 typedef void (*ib_rbt_print_node)(const ib_rbt_node_t* node);
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 42d40d0fd7e..99f7f940125 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -2529,21 +2529,26 @@ void innodb_shutdown()
 	/* 4. Free all allocated memory */
 
 	pars_lexer_close();
 	recv_sys.close();
 
 	ut_ad(buf_pool_ptr || !srv_was_started);
 	if (buf_pool_ptr) {
 		buf_pool_free(srv_buf_pool_instances);
 	}
 
-	sync_check_close();
+        // When this function is called, MariaDB server crashes,
+        // if the loops in buf0buf.cpp and dict0dict.cpp are prematurely left
+        // in the event of a shutdown.
+        // --> Comment out function sync_check_close().
+        //
+	// sync_check_close();
 
 	if (srv_was_started && srv_print_verbose_log) {
 		ib::info() << "Shutdown completed; log sequence number "
 			   << srv_shutdown_lsn
 			   << "; transaction id " << trx_sys.get_max_trx_id();
 	}
 
 	srv_start_state = SRV_START_STATE_NONE;
 	srv_was_started = false;
 	srv_start_has_been_called = false;
