]> git.saurik.com Git - apple/libc.git/blobdiff - gen/FreeBSD/err.c
Libc-1272.200.26.tar.gz
[apple/libc.git] / gen / FreeBSD / err.c
index aec34223d4934a4d0e1f0249534c0c907f602666..f763764dd9c1f201572cd7d2ba1097528e1eb59f 100644 (file)
@@ -159,6 +159,12 @@ err_set_file(void *fp)
 void
 err_set_exit(void (*ef)(int))
 {
 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;
 }
        _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))
 {
 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);
 }
        _e_err_exit.type = ef ? ERR_EXIT_BLOCK : ERR_EXIT_UNDEF;
        _e_err_exit.block = Block_copy(ef);
 }