I've recently upgraded LibGDX 1.10.0 and noticed a behavioural change that results in pooled components not having their reset() methods called. It appears that PooledEntity instances no longer have their reset() method called if the pool the Entity is being returned to is full, this has a few side effects:
Although your component pools may not be full, Component instances are being garbage collected if the Entity pool is full
You can no longer rely on reset() being called on a Poolable Component instance
I have tracked this behaviour down to this change to Poolable in LibGDX:
It would appear a discard() method has been added to Pool that is called should the above circumstance occur. Given Ashley's nature, might I suggest implementing this method in PooledEntity and simply calling reset() in it's implementation? This would keep behaviour consistent with how it used to function prior to this change in LibGDX.
If this is agreeable, may I make the change and submit a pull request?
Hello!
I've recently upgraded LibGDX 1.10.0 and noticed a behavioural change that results in pooled components not having their reset() methods called. It appears that PooledEntity instances no longer have their reset() method called if the pool the Entity is being returned to is full, this has a few side effects:
I have tracked this behaviour down to this change to Poolable in LibGDX:
https://github.com/libgdx/libgdx/commit/049174598204936eab55375079944983c39530e1#diff-2b502e40add95b689c7f66b2f0a0fa97d4b1d1961881443a6e4a7d470a2c6208
It would appear a discard() method has been added to Pool that is called should the above circumstance occur. Given Ashley's nature, might I suggest implementing this method in PooledEntity and simply calling reset() in it's implementation? This would keep behaviour consistent with how it used to function prior to this change in LibGDX.
If this is agreeable, may I make the change and submit a pull request?
Cheers, Fhox