Permalink
Browse files

[GH #765] do not destroy --leak-test interp with pending exceptions

  • Loading branch information...
1 parent d20f712 commit 2162db6ed2dee7f55fa6986620e7ddfaa0a8768c @rurban rurban committed Aug 23, 2012
Showing with 6 additions and 3 deletions.
  1. +1 −0 src/exit.c
  2. +5 −3 src/interp/api.c
View
1 src/exit.c
@@ -137,6 +137,7 @@ Parrot_x_execute_on_exit_handlers(PARROT_INTERP, int status)
/* It could be that the interpreter already is destroyed. See issue 765 */
interp->exit_handler_list = NULL;
+ interp->final_exception = NULL;
/* Re-enable GC, which we will want if GC finalizes */
Parrot_unblock_GC_mark(interp);
View
8 src/interp/api.c
@@ -450,9 +450,11 @@ Parrot_interp_really_destroy(PARROT_INTERP, int exit_code, SHIM(void *arg))
*/
/* we destroy all child interpreters and the last one too,
- * if the --leak-test commandline was given */
- if (! (interp->parent_interpreter
- || Interp_flags_TEST(interp, PARROT_DESTROY_FLAG)))
+ * if the --leak-test commandline was given, and there is no
+ * pending exception. */
+ if (! (interp->parent_interpreter)
+ || (Interp_flags_TEST(interp, PARROT_DESTROY_FLAG)
+ && !PMC_IS_NULL(interp->final_exception)))
return;
if (interp->parent_interpreter)

0 comments on commit 2162db6

Please sign in to comment.