Closed metaphore closed 9 months ago
You are right, adding the reset call would be problematic even if the lambda was given a Pool
receiver, since it's a protected function. However, it's pretty easy to implement - all it does is calling reset
on any object implementing the Poolable
interface. I'll change it so that the default discard
lambda attempts to reset the Poolable
objects.
Should be available in the snapshot version shortly. Cheers.
It seems like #363 brought a little inconsistency in how the pool discard logic works.
This is what the original discard method looks like:
And here's KTX:
So basically the
reset
call is gone and the defaultdiscard
parameter to the KTXpool
method is not replicating that logic. I don't think it's possible to call the samereset
instance method from the defaultdiscard
lambda parameter. So maybe adding an overload to thepool
method without thediscard
parameter and without thediscard(T)
method override would be a good solution.