summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index b9c7dcdac4..542bae7309 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3889,10 +3889,23 @@ if (HAVE_CMOV)
#endif /* ARCH_X86 */
}
+#ifdef PTW32_STATIC_LIB
+static void detach_ptw32(void)
+{
+ pthread_win32_thread_detach_np();
+ pthread_win32_process_detach_np();
+}
+#endif
+
/* This preprocessor directive is a hack to generate a mplayer-nomain.o object
* file for some tools to link against. */
#ifndef DISABLE_MAIN
int main(int argc,char* argv[]){
+#ifdef PTW32_STATIC_LIB
+ pthread_win32_process_attach_np();
+ pthread_win32_thread_attach_np();
+ atexit(detach_ptw32);
+#endif
if (argc > 1 && !strcmp(argv[1], "-leak-report"))
talloc_enable_leak_report();