summaryrefslogtreecommitdiffstats
path: root/player/javascript.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-25 18:17:25 -0500
committerDudemanguy <random342@airmail.cc>2023-10-26 16:49:56 +0000
commitb9c42755a75d74f5cd48737e714d31589fcac6a0 (patch)
treeec3d9db28c1f762844008ef64a2435170a9e150c /player/javascript.c
parent1be0d0aa844a6c72b25d9b21244a81fd96e96ee9 (diff)
downloadmpv-b9c42755a75d74f5cd48737e714d31589fcac6a0.tar.bz2
mpv-b9c42755a75d74f5cd48737e714d31589fcac6a0.tar.xz
javascript: use --js-memory-report option instead of MPV_LEAK_REPORT
The MPV_LEAK_REPORT environment variable was previously read in order to determine whether or not to enable memory reporting for javascript scripts. This is kind of weird and deviates from the norm of exposing an option to the user. So let's just add --js-memory-report and disable it by default instead.
Diffstat (limited to 'player/javascript.c')
-rw-r--r--player/javascript.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/player/javascript.c b/player/javascript.c
index ec14582575..60777baecf 100644
--- a/player/javascript.c
+++ b/player/javascript.c
@@ -535,8 +535,7 @@ static int s_load_javascript(struct mp_script_args *args)
js_Alloc alloc_fn = NULL;
void *actx = NULL;
- char *mem_report = getenv("MPV_LEAK_REPORT");
- if (mem_report && strcmp(mem_report, "1") == 0) {
+ if (args->mpctx->opts->js_memory_report) {
alloc_fn = mp_js_alloc;
actx = ctx;
}