Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory issue: scene stuck in GLRenderLists #85

Open
Displee opened this issue Jul 3, 2024 · 0 comments · Fixed by Displee/three.kt#3
Open

Memory issue: scene stuck in GLRenderLists #85

Displee opened this issue Jul 3, 2024 · 0 comments · Fixed by Displee/three.kt#3

Comments

@Displee
Copy link
Contributor

Displee commented Jul 3, 2024

Dispose scene implementation is not finished. The scene should be removed from the GLRenderLists.lists on dispose, but it never is.

Three.js code: https://github.com/mrdoob/three.js/blob/r106/src/renderers/webgl/WebGLRenderLists.js#L163

function onSceneDispose( event ) {

var scene = event.target;

scene.removeEventListener( 'dispose', onSceneDispose );

delete lists[ scene.id ];

}

threekt code: https://github.com/markaren/three.kt/blob/master/core/src/main/kotlin/info/laht/threekt/renderers/opengl/GLRenderLists.kt#L39

override fun onEvent(event: Event) {
    val scene = event.target as Scene
    scene.removeEventListener("dispose", this)
}

Because the scene is never removed, memory gets filled up when doing heavy rendering.

@Displee Displee changed the title Memory issue: scene stuck GLRenderLists Memory issue: scene stuck in GLRenderLists Jul 3, 2024
@Displee Displee reopened this Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant