emscripten-core / emscripten-core/emscripten

C++11 leak memory on `emscripten_exit_with_live_runtime`

Open
#17,091 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

In fact any C++ objects on the stack when `emscripten_exit_with_live_runtime` will leak unless explictly freed.

C++11 thread functions have a unique pointer in their main entry point:

https://github.com/emscripten-core/emscripten/blob/719b7c6a044ea1193cd602a17bb437f1b21dc931/system/lib/libcxx/include/thread#L290

Calling `emscripten_exit_with_live_runtime` from within a thread is unusual, and the load is just 8 bytes so its probably not urgent to fix.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.