Open mgsloan opened 6 years ago
Isn't the only way to solve this by giving LocalPools a unique id and having Pool store a Map of ids that have already been decremented?
Actually... I think that wouldn't work. The fact that no one else has chimed in makes me wonder if the burden is on the user of the library here and this isn't a pattern Pool aims at preventing. That seems wrong to me though.
The definition of
destroyResource
is:inUse
always gets decremented, regardless of if this function has been called multiple times for the same resource. Here is a demonstration of the issue:Output: