PATCH: avifile init/exit handling

Marcus Meissner marcus at jet.franken.de
Wed Jul 6 01:14:14 CDT 2005


Hi,

This implements Roberts suggestion of uninitializing Ole if it is no
longer needed.

Ciao, Marcus

Changelog:
	Call OleUninitialize() on last AVIFileExit()

Index: dlls/avifil32/api.c
===================================================================
RCS file: /home/wine/wine/dlls/avifil32/api.c,v
retrieving revision 1.34
diff -u -r1.34 api.c
--- dlls/avifil32/api.c	2 Jul 2005 10:49:39 -0000	1.34
+++ dlls/avifil32/api.c	6 Jul 2005 06:12:48 -0000
@@ -45,6 +45,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(avifile);
 
+static int ole_initialized = 0;
+
 
 /***********************************************************************
  * for AVIBuildFilterW -- uses fixed size table
@@ -176,7 +178,8 @@
  *		AVIFileInit		(AVIFILE.100)
  */
 void WINAPI AVIFileInit(void) {
-  OleInitialize(NULL);
+  if (!ole_initialized++)
+    OleInitialize(NULL);
 }
 
 /***********************************************************************
@@ -184,9 +187,8 @@
  *		AVIFileExit		(AVIFILE.101)
  */
 void WINAPI AVIFileExit(void) {
-  /* need to free ole32.dll if we are the last exit call */
-  /* OleUnitialize() */
-  FIXME("(): stub!\n");
+  if (!--ole_initialized)
+    OleUninitialize();
 }
 
 /***********************************************************************
-- 



More information about the wine-patches mailing list