Creating a reference counted type?

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 12 07:49:18 PDT 2016


On Sunday, 12 June 2016 at 14:45:12 UTC, ketmar wrote:
> ahem... wut?! we have one copy of our struct freed half the 
> way, and another copy has refcount of 2, so it won't be freed 
> at all. it doesn't so innocent as it looks: we may try to use 
> `f` in `main`... just to find out that resources was 
> mysteriously freed, and refcount is total garbage.

Hmmm. I thought it looked *too* simple. Have you any idea if 
there is a simple solution to this?


More information about the Digitalmars-d-learn mailing list