diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-07-27 19:51:55 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-07-27 19:51:55 +0200 |
commit | 32e03eb30fb548a773ca013f7e0cc548fc7b5b2e (patch) | |
tree | 20b1e1f1ab23527b55b485aaf402d54497daf2aa | |
parent | efa862d4f89401c5148746a5aba4d88ed6b6cbaa (diff) | |
download | sciteco-32e03eb30fb548a773ca013f7e0cc548fc7b5b2e.tar.gz |
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.
-rw-r--r-- | src/spawn.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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 |