www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 924] New: GC collects valid objects

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: benoit 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


-- 
Feb 02 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=924


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed DMD 1.005


-- 
Feb 12 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=924






Added to DStress as
http://dstress.kuehne.cn/run/m/memory_management_06_A.d


-- 
Feb 15 2007