[Issue 924] New: GC collects valid objects

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 2 16:54:07 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=924

           Summary: GC collects valid objects
           Product: D
           Version: 1.004
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: benoit at tionex.de


This problem occurs, if an array is initialized with the static initializer:

import std.gc;
extern(C) int printf( char*, ... );
class C{
    ~this(){
        printf( "DTor()\n" );
    }
}
C[] carr;
void setup(){
    carr = [ new C, new C];
}
void main(){
    setup();
    fullCollect();
    printf( "complete\n" );
}
// expected output
complete
DTor()
DTor()
// but it is
DTor()
DTor()
complete


-- 



More information about the Digitalmars-d-bugs mailing list