Skip to content

Possible memory leak in RenderContext #1311

@riccardobl

Description

@riccardobl

https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java#L222

public final Image[] boundTextures = new Image[16];

Let's say for example an application uses maximum 14 textures in every material.
If during runtime the application changes to use max 13 textures, the 14 unit will never be touched again and the reference held by RenderContext will prevent the image object from beeing gced.

Possible fix: Use WeakReferences

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions