Skip to content

Commit

Permalink
Fix #77 where attempt to remove a Component from an
Browse files Browse the repository at this point in the history
already-reset PooledEntity would cause an IllegalArgumentException.
  • Loading branch information
SgtCoDFish committed Oct 7, 2014
1 parent 963b754 commit a276fe4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ashley/src/com/badlogic/ashley/core/PooledEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ private class PooledEntity extends Entity implements Poolable {
@Override
Component removeInternal(Class<? extends Component> componentType){
Component component = super.removeInternal(componentType);
componentPools.free(component);

if(component != null) {
componentPools.free(component);
}

return component;
}

Expand Down

0 comments on commit a276fe4

Please sign in to comment.