[polypaudio-commits] r837 - in /trunk/src: polyp/context.c polypcore/dllmain.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu May 11 04:02:26 PDT 2006


Author: ossman
Date: Thu May 11 13:02:25 2006
New Revision: 837

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=837&root=polypaudio&view=rev
Log:
Do WSAStartup() in the DLL entry routine instead of at context creation.

Modified:
    trunk/src/polyp/context.c
    trunk/src/polypcore/dllmain.c

Modified: trunk/src/polyp/context.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/context.c?rev=837&root=polypaudio&r1=836&r2=837&view=diff
==============================================================================
--- trunk/src/polyp/context.c (original)
+++ trunk/src/polyp/context.c Thu May 11 13:02:25 2006
@@ -142,13 +142,6 @@
 #endif
     pa_client_conf_env(c->conf);
 
-#ifdef OS_IS_WIN32
-    {
-        WSADATA data;
-        WSAStartup(MAKEWORD(2, 0), &data);
-    }
-#endif
-    
     return c;
 }
 
@@ -187,10 +180,6 @@
     pa_xfree(c->name);
     pa_xfree(c->server);
     pa_xfree(c);
-
-#ifdef OS_IS_WIN32
-    WSACleanup();
-#endif
 }
 
 pa_context* pa_context_ref(pa_context *c) {

Modified: trunk/src/polypcore/dllmain.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/dllmain.c?rev=837&root=polypaudio&r1=836&r2=837&view=diff
==============================================================================
--- trunk/src/polypcore/dllmain.c (original)
+++ trunk/src/polypcore/dllmain.c Thu May 11 13:02:25 2006
@@ -34,12 +34,21 @@
 extern pa_set_root(HANDLE handle);
 
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
-    if (fdwReason != DLL_PROCESS_ATTACH)
-        return TRUE;
+    WSADATA data;
 
-    if (!pa_set_root(hinstDLL))
-        return FALSE;
+    switch (fdwReason) {
 
+    case DLL_PROCESS_ATTACH:
+        if (!pa_set_root(hinstDLL))
+            return FALSE;
+        WSAStartup(MAKEWORD(2, 0), &data);
+        break;
+
+    case DLL_PROCESS_DETACH:
+        WSACleanup();
+        break;
+
+    }
     return TRUE;
 }
 




More information about the pulseaudio-commits mailing list