From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Serge Petrenko Subject: [PATCH v5 3/3] box: get rid of atexit() for calling cleanup routines Date: Fri, 25 Jan 2019 18:41:34 +0300 Message-Id: <12ddd86a29af0d38f773af9d2304a4e583c9c196.1548430046.git.sergepetrenko@tarantool.org> In-Reply-To: References: In-Reply-To: References: To: vdavydov.dev@gmail.com, kostja@tarantool.org Cc: tarantool-patches@freelists.org, Serge Petrenko List-ID: Move a call to tarantool_free() to the end of main(). We needn't call atexit() at all anymore, since we've implemented on_shutdown triggers and patched os.exit() so that when exiting not due to a fatal signal (when no cleanup routines are called anyway) control always reaches a call to tarantool_free(). --- src/main.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.cc b/src/main.cc index a3d1a6f22..3fc2dd310 100644 --- a/src/main.cc +++ b/src/main.cc @@ -800,9 +800,6 @@ main(int argc, char **argv) trigger_create(&shutdown_trig, break_loop, NULL, NULL); trigger_add(&box_on_shutdown, &shutdown_trig); - /* main core cleanup routine */ - atexit(tarantool_free); - if (!loop()) panic("%s", "can't init event loop"); @@ -841,5 +838,6 @@ main(int argc, char **argv) if (start_loop) say_crit("exiting the event loop"); /* freeing resources */ + tarantool_free(); return exit_code; } -- 2.17.2 (Apple Git-113)