December 03, 2012 [Issue 9111] New: Parent object getting GCed before the elements of child dynamic array | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=9111 Summary: Parent object getting GCed before the elements of child dynamic array Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: puneet@coverify.org --- Comment #0 from Puneet Goel <puneet@coverify.org> 2012-12-03 00:51:58 PST --- The following code segfaults when compiled with current DMD github snapshot. It seems that array elements of "frop" are getting garbage collected after the parent class Foo's object is collected. Works fine with dmd-2.059 and dmd-2.060. class Frop { bar _v; } struct bar { static Foo _root; ~this() { _root.del(); } } class Foo { int _x; Frop[] _frop; this() { bar._root = this; _frop = [new Frop()]; } void del() {} } void main() { auto foo = new Foo ; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 03, 2012 [Issue 9111] Parent object getting GCed before the elements of child dynamic array | ||||
---|---|---|---|---|
| ||||
Posted in reply to Puneet Goel | http://d.puremagic.com/issues/show_bug.cgi?id=9111 Maxim Fomin <maxim@maxim-fomin.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |maxim@maxim-fomin.ru Resolution| |INVALID --- Comment #1 from Maxim Fomin <maxim@maxim-fomin.ru> 2012-12-03 02:43:56 PST --- Not a bug http://forum.dlang.org/thread/mailman.2438.1354423511.5162.digitalmars-d@puremagic.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation