mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
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.
This commit is contained in:
committed by
Bjorn Winckler
parent
84a3908488
commit
9265b87738
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user