X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/974e388456677d82eb6d10d4fd72390641a5bdfe..70ad1dc8a19d6edd9b97aa81f32cfd65758ae97d:/gen/FreeBSD/err.c diff --git a/gen/FreeBSD/err.c b/gen/FreeBSD/err.c index aec3422..f763764 100644 --- a/gen/FreeBSD/err.c +++ b/gen/FreeBSD/err.c @@ -159,6 +159,12 @@ err_set_file(void *fp) void err_set_exit(void (*ef)(int)) { +#ifdef __BLOCKS__ + if (_e_err_exit.type == ERR_EXIT_BLOCK) { + Block_release(_e_err_exit.block); + _e_err_exit.block = NULL; + } +#endif /* __BLOCKS__ */ _e_err_exit.type = ef ? ERR_EXIT_FUNC : ERR_EXIT_UNDEF; _e_err_exit.func = ef; } @@ -167,6 +173,9 @@ err_set_exit(void (*ef)(int)) void err_set_exit_b(void (^ef)(int)) { + if (_e_err_exit.type == ERR_EXIT_BLOCK) { + Block_release(_e_err_exit.block); + } _e_err_exit.type = ef ? ERR_EXIT_BLOCK : ERR_EXIT_UNDEF; _e_err_exit.block = Block_copy(ef); }