File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,18 @@ pmclass SixModelObject manual_attrs dynpmc group nqp {
35
35
}
36
36
37
37
VTABLE void destroy() {
38
- /* Delegate to the representation. */
39
- REPR(SELF)->gc_free(interp, REPR_PMC(SELF), SELF);
38
+ /* Delegate to the representation.
39
+ * XXX There's a really nasty problem here. Since the GC provides no
40
+ * promises about ordering, the s-table may get collected before the
41
+ * last object pointing to it (a situation that arises when we have
42
+ * anonymous types). That means the REPR - which knows how to free
43
+ * the object - may be unreachable by the time we get here. Oops.
44
+ * For now, just leak the type object memory. The current REPR
45
+ * factoring is less than ideal in other ways too.
46
+ */
47
+ STable *st = STABLE(SELF);
48
+ if (st)
49
+ REPR(SELF)->gc_free(interp, REPR_PMC(SELF), SELF);
40
50
}
41
51
42
52
VTABLE PMC * find_method(STRING *name) {
You can’t perform that action at this time.
0 commit comments