#1417: MacRuby crashes when invokes a rb_exit. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by watson1978@…): it seems to crash when invoke the rb_exit's finalizer and GC's finalizer at same times. When disable GC at rb_exit, it seems to run fine. {{{ diff --git a/eval.c b/eval.c index 3ff9db7..7797b9a 100644 --- a/eval.c +++ b/eval.c @@ -94,6 +94,7 @@ ruby_finalize_1(void) void ruby_finalize(void) { + GC_DISABLE(); ruby_finalize_0(); ruby_finalize_1(); } diff --git a/macruby_internal.h b/macruby_internal.h index d088e9e..8ac08e2 100644 --- a/macruby_internal.h +++ b/macruby_internal.h @@ -33,6 +33,7 @@ void auto_zone_retain(void *zone, void *ptr); unsigned int auto_zone_release(void *zone, void *ptr); unsigned int auto_zone_retain_count(void *zone, const void *ptr); void *auto_zone_write_barrier_memmove(void *zone, void *dst, const void *src, size_t size); +void auto_collector_disable(void *zone); extern void *__auto_zone; #else extern auto_zone_t *__auto_zone; @@ -89,6 +90,8 @@ rb_objc_release(void *addr) } #define GC_RELEASE(obj) (rb_objc_release((void *)obj)) +#define GC_DISABLE() (auto_collector_disable(__auto_zone)) + // MacRubyIntern.h /* object.c */ }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1417#comment:1> MacRuby <http://macruby.org/>