lwjglgamedev / lwjglbook-leg

Source code of the chapters of the book 3D Game Development with LWJGL 3
https://ahbejarano.gitbook.io/lwjglgamedev/
Apache License 2.0
560 stars 202 forks source link

Fixing a memory leak #62

Closed Ramh5 closed 5 years ago

Ramh5 commented 5 years ago

I noticed that this change gets rid of the following memory leak message that we get when we close the application with the lwjglx debugger:

[LWJGL] 16777217 bytes leaked, thread 1 (main), address: 0x20F031D5040 at org.lwjgl.stb.STBImage.nstbi_load_from_memory(Native Method) at org.lwjgl.stb.STBImage.stbi_load_from_memory(STBImage.java:259) at org.lwjglx.debug.$Proxy$30.stbi_load_from_memory128(Unknown Source) at org.lwjglb.engine.graph.Texture.(Texture.java:65) at org.lwjglb.engine.graph.Texture.(Texture.java:55) at org.lwjglb.engine.loaders.assimp.TextureCache.getTexture(TextureCache.java:27) at org.lwjglb.engine.loaders.assimp.StaticMeshesLoader.processMaterial(StaticMeshesLoader.java:97) at org.lwjglb.engine.loaders.assimp.StaticMeshesLoader.load(StaticMeshesLoader.java:52) at org.lwjglb.engine.loaders.assimp.StaticMeshesLoader.load(StaticMeshesLoader.java:36) at org.lwjglb.game.DummyGame.init(DummyGame.java:61) at org.lwjglb.engine.GameEngine.init(GameEngine.java:53) at org.lwjglb.engine.GameEngine.run(GameEngine.java:40) at org.lwjglb.game.Main.main(Main.java:20)

lwjglgamedev commented 5 years ago

Thanks I forgot to revert this change.