http://code.google.com/p/decnum-dynpmcs/source/detail?r=180
Modified:
/trunk/src/pmc/decintcontext.pmc
/trunk/src/pmc/decnumcontext.pmc
=======================================
--- /trunk/src/pmc/decintcontext.pmc Wed Aug 26 17:36:58 2009
+++ /trunk/src/pmc/decintcontext.pmc Fri Aug 28 18:08:00 2009
@@ -53,9 +53,11 @@
attr->exceptions = DEC_Errors;
attr->ctx = mem_allocate_typed(decContext);
set_context_defaults(attr->ctx);
-
- PObj_active_destroy_SET(SELF);
- }
+ }
+/* PObj_active_destroy_SET(SELF);
+ * We are leaking memory with this, but the alternative is a segfault.
+ * This PMC only gets collected on interpreter destruction anyway.
+ */
}
METHOD restore_defaults() {
=======================================
--- /trunk/src/pmc/decnumcontext.pmc Wed Aug 26 17:39:45 2009
+++ /trunk/src/pmc/decnumcontext.pmc Fri Aug 28 18:08:00 2009
@@ -54,14 +54,17 @@
attr->exceptions = DEC_Errors;
attr->ctx = mem_allocate_typed(decContext);
set_context_defaults(attr->ctx);
-
- PObj_active_destroy_SET(SELF);
- }
+ }
+/* PObj_active_destroy_SET(SELF);
+ * We are leaking memory with this, but the alternative is a segfault.
+ * This PMC only gets collected on interpreter destruction anyway.
+ */
}
VTABLE void destroy() {
mem_sys_free(PARROT_DECNUMCONTEXT(SELF)->ctx);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
VTABLE void freeze(visit_info *info) {