3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-20 04:43:39 +00:00

fix crash on Mac due to different destruction order of globals

the mutex in memory_manager has to be destroyed after all mem deallocations happen
This commit is contained in:
Nuno Lopes 2019-06-13 11:22:18 +01:00
parent 2bee9a062f
commit cf3e649462
12 changed files with 80 additions and 120 deletions

View file

@ -16,9 +16,8 @@ Author:
#include "util/rlimit.h"
#include "util/gparams.h"
#include <signal.h>
#include <mutex>
extern std::mutex* g_stat_mux;
static std::mutex display_stats_mux;
static lp::lp_solver<double, double>* g_solver = nullptr;
@ -31,14 +30,14 @@ static void display_statistics() {
static void STD_CALL on_ctrl_c(int) {
signal (SIGINT, SIG_DFL);
{
std::lock_guard<std::mutex> lock(*g_stat_mux);
std::lock_guard<std::mutex> lock(display_stats_mux);
display_statistics();
}
raise(SIGINT);
}
static void on_timeout() {
std::lock_guard<std::mutex> lock(*g_stat_mux);
std::lock_guard<std::mutex> lock(display_stats_mux);
display_statistics();
exit(0);
}