summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/tech-overview.txt3
-rw-r--r--options/options.c4
-rw-r--r--player/main.c14
3 files changed, 4 insertions, 17 deletions
diff --git a/DOCS/tech-overview.txt b/DOCS/tech-overview.txt
index fd6a7a1fb7..914b2222b4 100644
--- a/DOCS/tech-overview.txt
+++ b/DOCS/tech-overview.txt
@@ -75,8 +75,7 @@ talloc.h & talloc.c:
allocation call will never return NULL.
One very useful feature of talloc is fast tracking of memory leaks. ("Fast"
- as in it doesn't require valgrind.) You can enable it by passing the option
- --leak-report as first parameter, or better, setting the
+ as in it doesn't require valgrind.) You can enable it by setting the
MPV_LEAK_REPORT environment variable to "1":
export MPV_LEAK_REPORT=1
This will list all unfree'd allocations on exit.
diff --git a/options/options.c b/options/options.c
index 23bfef5612..c5fa2b427b 100644
--- a/options/options.c
+++ b/options/options.c
@@ -95,10 +95,6 @@ const m_option_t mp_opts[] = {
{ "show-profile", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
{ "list-options", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
- // handled in main.c (looks at the raw argv[])
- { "leak-report", CONF_TYPE_STORE, CONF_GLOBAL | CONF_NOCFG | M_OPT_FIXED,
- .offset = -1 },
-
OPT_FLAG("shuffle", shuffle, 0),
// ------------------------- common options --------------------
diff --git a/player/main.c b/player/main.c
index dc5c901447..ff7450f164 100644
--- a/player/main.c
+++ b/player/main.c
@@ -272,16 +272,6 @@ static bool handle_help_options(struct MPContext *mpctx)
return opt_exit;
}
-static void osdep_preinit(int argc, char **argv)
-{
- char *enable_talloc = getenv("MPV_LEAK_REPORT");
- if (argc > 1 && (strcmp(argv[1], "-leak-report") == 0 ||
- strcmp(argv[1], "--leak-report") == 0))
- enable_talloc = "1";
- if (enable_talloc && strcmp(enable_talloc, "1") == 0)
- talloc_enable_leak_report();
-}
-
static int cfg_include(void *ctx, char *filename, int flags)
{
struct MPContext *mpctx = ctx;
@@ -486,7 +476,9 @@ int mp_initialize(struct MPContext *mpctx, char **options)
int mpv_main(int argc, char *argv[])
{
- osdep_preinit(argc, argv);
+ char *enable_talloc = getenv("MPV_LEAK_REPORT");
+ if (enable_talloc && strcmp(enable_talloc, "1") == 0)
+ talloc_enable_leak_report();
struct MPContext *mpctx = mp_create();
struct MPOpts *opts = mpctx->opts;