Skip to content

Commit

Permalink
Fixed memory problems
Browse files Browse the repository at this point in the history
  • Loading branch information
lwjglgamedev committed Oct 3, 2019
1 parent b65bb6b commit e30d9e1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions chapter28/src/main/java/org/lwjglb/engine/graph/Texture.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static org.lwjgl.opengl.GL30.*;
import static org.lwjgl.stb.STBImage.*;
import org.lwjgl.system.MemoryStack;
import org.lwjgl.system.MemoryUtil;
import static org.lwjgl.system.MemoryStack.*;
import org.lwjglb.engine.Utils;

Expand Down Expand Up @@ -81,8 +80,7 @@ public Texture(ByteBuffer imageData) {
// Generate Mip Map
glGenerateMipmap(GL_TEXTURE_2D);

stbi_image_free(imageData);
MemoryUtil.memFree(decodedImage);
stbi_image_free(decodedImage);
}
}

Expand Down

0 comments on commit e30d9e1

Please sign in to comment.