aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index 18c32f17..7471c3dd 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -30,13 +30,6 @@
#include "alu.h"
-typedef struct ALechoStateFactory {
- DERIVE_FROM_TYPE(ALeffectStateFactory);
-} ALechoStateFactory;
-
-static ALechoStateFactory EchoFactory;
-
-
typedef struct ALechoState {
DERIVE_FROM_TYPE(ALeffectState);
@@ -176,6 +169,10 @@ static void ALechoState_Delete(ALechoState *state)
DEFINE_ALEFFECTSTATE_VTABLE(ALechoState);
+typedef struct ALechoStateFactory {
+ DERIVE_FROM_TYPE(ALeffectStateFactory);
+} ALechoStateFactory;
+
ALeffectState *ALechoStateFactory_create(ALechoStateFactory *UNUSED(factory))
{
ALechoState *state;
@@ -198,16 +195,10 @@ ALeffectState *ALechoStateFactory_create(ALechoStateFactory *UNUSED(factory))
DEFINE_ALEFFECTSTATEFACTORY_VTABLE(ALechoStateFactory);
-
-static void init_echo_factory(void)
-{
- SET_VTABLE2(ALechoStateFactory, ALeffectStateFactory, &EchoFactory);
-}
-
ALeffectStateFactory *ALechoStateFactory_getFactory(void)
{
- static pthread_once_t once = PTHREAD_ONCE_INIT;
- pthread_once(&once, init_echo_factory);
+ static ALechoStateFactory EchoFactory = { { GET_VTABLE2(ALechoStateFactory, ALeffectStateFactory) } };
+
return STATIC_CAST(ALeffectStateFactory, &EchoFactory);
}