Skip to content

Commit

Permalink
Fixes GWT crash when using PooledEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
dsaltares committed Oct 13, 2014
1 parent da5e089 commit cb33472
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ashley/src/com/badlogic/ashley/core/PooledEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.badlogic.gdx.utils.Pool;
import com.badlogic.gdx.utils.Pool.Poolable;
import com.badlogic.gdx.utils.ReflectionPool;
import com.badlogic.gdx.utils.reflect.ClassReflection;


/**
Expand Down Expand Up @@ -95,10 +94,9 @@ public void clearPools() {
@Override
protected void removeEntityInternal(Entity entity) {
super.removeEntityInternal(entity);

if (ClassReflection.isAssignableFrom(PooledEntity.class, entity.getClass())) {
PooledEntity pooledEntity = (PooledEntity) entity;
entityPool.free(pooledEntity);

if (entity instanceof PooledEntity) {
entityPool.free((PooledEntity)entity);
}
}

Expand Down

0 comments on commit cb33472

Please sign in to comment.