Derelict SFML destructor crashes
    Jeremy DeHaan 
    dehaan.jeremiah at gmail.com
       
    Mon Dec 17 19:17:04 PST 2012
    
    
  
On Tuesday, 18 December 2012 at 01:24:43 UTC, Mike Parker wrote:
> No, that's a bad idea. What if the C library you are using 
> maintains some sort of internal bookkeeping related to the 
> pointer? What if it keeps a copy of the pointer internally? If 
> the GC collects your D-side pointer, how is the C library 
> supposed to know it's time to cleanup everything associated 
> with that pointer?
I definitely hadn't considered that. I was mainly talking about 
the CSFML library, but I think even then trying to add the 
pointers into the GC would cause the problems you mention. Thanks 
for all the insight!
    
    
More information about the Digitalmars-d-learn
mailing list