dxgi: Remove an unneeded refcount field.

Francois Gouget fgouget at codeweavers.com
Wed Nov 16 09:27:45 CST 2011


---

I don't see the point of the dll refcounting here. Wine does it for us 
and if DLL_PROCESS_{ATTACH,DETACH} cannot be relied upon then most of 
the DllMain() implementations are totally wrong.

 dlls/dxgi/dxgi_main.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c
index 2ef5072..36e3326 100644
--- a/dlls/dxgi/dxgi_main.c
+++ b/dlls/dxgi/dxgi_main.c
@@ -39,7 +39,6 @@ struct dxgi_main
     HMODULE d3d10core;
     struct dxgi_device_layer *device_layers;
     UINT layer_count;
-    LONG refcount;
 };
 static struct dxgi_main dxgi_main;
 
@@ -65,11 +64,10 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
     {
         case DLL_PROCESS_ATTACH:
             DisableThreadLibraryCalls(hInstDLL);
-            ++dxgi_main.refcount;
             break;
 
         case DLL_PROCESS_DETACH:
-            if (!--dxgi_main.refcount) dxgi_main_cleanup();
+            dxgi_main_cleanup();
             break;
     }
 
-- 
1.7.7.1




More information about the wine-patches mailing list