Reset DYLD_INSERT_LIBRARIES on startup on OS X

This prevents subprocesses (e.g. those launched with Lua's os.execute)
from attempting to load libdfhack.dylib and aborting due to an
architecture mismatch.
develop
lethosor 2015-04-06 17:05:36 -04:00
parent fab7887f20
commit 62cfd0b8ca
1 changed files with 3 additions and 0 deletions

@ -303,6 +303,9 @@ DFhackCExport int DFH_SDL_Init(uint32_t flags)
assert(_SDL_Init && _SDL_Quit && _SDL_PollEvent);
fprintf(stderr, "dfhack: hooking successful\n");
// prevent any subprocesses from trying to load libdfhack.dylib
setenv("DYLD_INSERT_LIBRARIES", "", 1);
DFHack::Core & c = DFHack::Core::getInstance();
int ret = SDL_Init(flags);