Skip to content
Snippets Groups Projects
Commit e99e5ee8 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

gh-584: box_free() is called even if box is not initialized

Do stuff in box_free() only if initialization has succeeded.
parent c9e58caa
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,7 @@ box_process_func box_process = process_ro; ...@@ -59,6 +59,7 @@ box_process_func box_process = process_ro;
struct recovery_state *recovery; struct recovery_state *recovery;
bool snapshot_in_progress = false; bool snapshot_in_progress = false;
static bool box_init_done = false;
static void static void
process_ro(struct request *request, struct port *port) process_ro(struct request *request, struct port *port)
...@@ -372,17 +373,23 @@ box_set_cluster_uuid() ...@@ -372,17 +373,23 @@ box_set_cluster_uuid()
void void
box_free(void) box_free(void)
{ {
if (recovery == NULL) if (recovery) {
return; recovery_exit(recovery);
session_free(); recovery = NULL;
user_cache_free(); }
schema_free(); /*
tuple_free(); * See gh-584 "box_free() is called even if box is not
port_free(); * initialized
recovery_exit(recovery); */
recovery = NULL; if (box_init_done) {
engine_shutdown(); session_free();
stat_free(); user_cache_free();
schema_free();
tuple_free();
port_free();
engine_shutdown();
stat_free();
}
} }
static void static void
...@@ -486,6 +493,7 @@ box_init(void) ...@@ -486,6 +493,7 @@ box_init(void)
say_info("ready to accept requests"); say_info("ready to accept requests");
fiber_gc(); fiber_gc();
box_init_done = true;
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment