[Gc] [gc 6.8] crash when deleting under VC++ 8

Cyril cyril.delmas at cgin.fr
Thu Dec 13 06:56:23 PST 2007


Hello all,

1- I use the gc 6.8 and I have a problem : when I try to execute the 
following code, I get a crash :
for (i = 0; i < 1000; i++) {
            A* a = (A*) Undisguise( as[ i ] );
            B* b = (B*) Undisguise( bs[ i ] );
            a->Test( i );
            delete a; // crash here (debug assertion failure : invalid 
address)
            b->Test( i );
            B::Deleting( 1 );
            delete b;
            B::Deleting( 0 );
#        ifdef FINALIZE_ON_DEMAND
            GC_invoke_finalizers();
#        endif
}

This is an excerpt from test_cpp.cc.
Can anybody help me ?


2- I have another question : why does the garbage collector used as a 
leak detector detect all gc-managed pointers as leaks ?

Thanks for all !


More information about the Gc mailing list