summaryrefslogtreecommitdiff
path: root/audio/xmms-arts/files/patch-init.c
blob: 564b289eaa5950cabc5afc46c8c445ec6c7a90f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- init.c.orig	Fri Sep  1 10:35:03 2000
+++ init.c	Thu Feb  5 02:53:58 2004
@@ -20,6 +20,7 @@
  */
 
 #include "artsout.h"
+#include <dlfcn.h>
 
 aRtsConfig arts_cfg;
 
@@ -39,4 +40,14 @@
 		xmms_cfg_read_int(cfgfile, "aRts", "prebuffer", &arts_cfg.prebuffer);
 		xmms_cfg_free(cfgfile);
 	}
+
+	/*
+	 * This is a hack to prevent unloading of libstdc++
+	 * (required by arts libraries) in arts_free() but before
+	 * this thread is terminated. libstdc++ registers thread cleanup
+	 * handler and xmms crashes when this cleanup function is called
+	 * on thread termination.
+	 */
+	if (dlopen("libstdc++.so", RTLD_NOW | RTLD_GLOBAL) == NULL)
+		fprintf(stderr, "Failed to preload libstdc++.so\n");
 }