Stopped using static vector
Using std::vector will cause g_col to be released before the logger thread exits, causing the logger thread to touch freed memory causing a crash
This commit is contained in:
parent
c827365ef4
commit
3d11a9b17f
|
|
@ -49,7 +49,7 @@ enum common_log_col : int {
|
||||||
};
|
};
|
||||||
|
|
||||||
// disable colors by default
|
// disable colors by default
|
||||||
static std::vector<const char *> g_col = {
|
static const char* g_col[] = {
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
|
@ -338,7 +338,7 @@ public:
|
||||||
g_col[COMMON_LOG_COL_CYAN] = LOG_COL_CYAN;
|
g_col[COMMON_LOG_COL_CYAN] = LOG_COL_CYAN;
|
||||||
g_col[COMMON_LOG_COL_WHITE] = LOG_COL_WHITE;
|
g_col[COMMON_LOG_COL_WHITE] = LOG_COL_WHITE;
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; i < g_col.size(); i++) {
|
for (size_t i = 0; i < std::size(g_col); i++) {
|
||||||
g_col[i] = "";
|
g_col[i] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue