Re: reference counting resources but NOT memory

2021-01-16 Thread rikki cattermole via Digitalmars-d-learn
What you are describing sounds like regular reference counting. All resources (i.e. windows) are pinned somewhere in memory. Its just that you have to use special API's to destroy them rather than free.

reference counting resources but NOT memory

2021-01-16 Thread Tove via Digitalmars-d-learn
Is there any elegant/smart solution to reference counting resources without ever freeing any objects? When the ref hits 0 it should free some other resource that isn't memory... Resource[10] resources; resources[3].inc; // 1 ref - 0->1 transition enable some feature resources[3].dec; // 0 r