From 131638fa18090f29219facdaac61c00e76368570 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 16 Feb 2008 18:26:01 +0100 Subject: [PATCH] No CF calls between fork() and exec() Ensure no CoreFoundation calls are made between fork() and exec() otherwise Mac OS X may crash and burn. --- src/MacVim/gui_macvim.m | 3 --- src/gui.c | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index 7e1afa16..2e878268 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -1527,9 +1527,6 @@ gui_macvim_add_to_find_pboard(char_u *pat) { if (!pat) return; - // HACK: Do not call Cocoa during a fork or bad things (TM) will happen. - if (gui.dofork) return; - #ifdef FEAT_MBYTE pat = CONVERT_TO_UTF8(pat); #endif diff --git a/src/gui.c b/src/gui.c index c196f82b..27230828 100644 --- a/src/gui.c +++ b/src/gui.c @@ -163,6 +163,10 @@ http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fork.2.h } newargv[argc+1] = NULL; + /* shut down all the stuff we just started, just to start + * it again from the exec :-\ */ + prepare_getout(); + pid = fork(); switch(pid) { case -1: @@ -173,10 +177,6 @@ http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fork.2.h case 0: /* Child. */ - /* shut down all the stuff we just started, just to start - * it again from the exec :-\ */ - prepare_getout(); - /* make sure we survive our shell */ setsid(); -- 2.11.4.GIT