GC can collect object allocated in function, despite a pointer to the object living on?
    "岩倉 澪" via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Sat Aug 16 15:49:29 PDT 2014
    
    
  
Thank you for the help! I just removed the unnecessary
indirection and it is working great!
I was aware that interface and object variables are reference
types, but it slipped my mind. I'm too used to the C++ way of
things still :p
On Saturday, 16 August 2014 at 22:41:45 UTC, Sean Kelly wrote:
> Interface and object variables are reference types--you don't
> need the '*' to make them so.  By adding the extra layer of
> indirection you're losing the only reference the GC can decipher
> to the currentState instance.
    
    
More information about the Digitalmars-d-learn
mailing list