summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mplayer.c b/mplayer.c
index 963d505637..48758b2967 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3861,6 +3861,13 @@ static void detach_ptw32(void)
static void osdep_preinit(int *p_argc, char ***p_argv)
{
+ char *enable_talloc = getenv("MPLAYER_LEAK_REPORT");
+ if (*p_argc > 1 && (strcmp((*p_argv)[1], "-leak-report") == 0
+ || strcmp((*p_argv)[1], "--leak-report") == 0))
+ enable_talloc = "1";
+ if (enable_talloc && strcmp(enable_talloc, "1") == 0)
+ talloc_enable_leak_report();
+
GetCpuCaps(&gCpuCaps);
#ifdef __MINGW32__
@@ -3900,10 +3907,6 @@ int main(int argc, char *argv[])
argv++;
}
- if (argc > 0 && (!strcmp(argv[0], "-leak-report")
- || !strcmp(argv[0], "--leak-report")))
- talloc_enable_leak_report();
-
struct MPContext *mpctx = talloc(NULL, MPContext);
*mpctx = (struct MPContext){
.osd_function = OSD_PLAY,