From 32e03eb30fb548a773ca013f7e0cc548fc7b5b2e Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 27 Jul 2015 19:51:55 +0200 Subject: work around segfaults on Haiku * there appears to be a bug in Haiku's glib v2.38 g_main_context_unref(). However I could not find a fix in glib's log. * as a workaround, simply do not unref the main context. Memory is reclaimed after program termination anyway. --- src/spawn.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/spawn.cpp') diff --git a/src/spawn.cpp b/src/spawn.cpp index a6ca4e8..cd160f9 100644 --- a/src/spawn.cpp +++ b/src/spawn.cpp @@ -236,7 +236,16 @@ StateExecuteCommand::StateExecuteCommand() : StateExpectString() StateExecuteCommand::~StateExecuteCommand() { g_main_loop_unref(ctx.mainloop); +#ifndef G_OS_HAIKU + /* + * Apparently, there's some kind of double-free + * bug in Haiku's glib-2.38. + * It is unknown whether this is has + * already been fixed and affects other platforms + * (but I never observed any segfaults). + */ g_main_context_unref(ctx.mainctx); +#endif } void -- cgit v1.2.3