Remove debug code from release mode

This commit is contained in:
Chris Lee
2019-07-12 22:47:07 -07:00
parent 784edaccd2
commit 22ce7c5427
4 changed files with 39 additions and 30 deletions

View File

@@ -797,6 +797,7 @@ void tint2(int argc, char **argv, gboolean *restart)
int main(int argc, char **argv)
{
#ifdef USE_REAL_MALLOC
if (!getenv("G_SLICE") && setenv("G_SLICE", "always-malloc", 1) == 0) {
fprintf(stderr,
YELLOW "tint2: reexecuting tint2 without glib slice allocator..." RESET "\n");
@@ -804,6 +805,11 @@ int main(int argc, char **argv)
fprintf(stderr, RED "tint2: %s %d: execvp failed! carrying on..." RESET "\n",
__FILE__, __LINE__);
}
#else
fprintf(stderr, "tint2: Using glib slice allocator (default). "
"Run tint2 with environment variable G_SLICE=always-malloc "
"in case of strange behavior or crashes\n");
#endif
gboolean restart;
do {
restart = FALSE;