Closed ThaBalla1148 closed 9 years ago
Thanks for finding this!, will get it merged, but I also wanted to add that as general rule, you want to avoid usage of addItem removeItem on the fly. I mean you can do it but not too much as it is a slow operation, and if you need to add and remove a lot, then maybe consider using addActor instead.
Hello, thanks for accepting my pull request and your recommendation. I will try using the following for adding and removing dynamic items from the scene (i.e. bullets):
Adding:
CompositeItem item = sceneLoader.getLibraryAsActor(libraryItemName);
sceneLoader.getRoot().addActor(item);
Removing:
item.remove();
Fixed a memory leak caused by CompositeItem.itemLayerMap holding a reference to the IBaseItem being removed from the parent item.