[winearts] don't call arts_free if arts_init wasn't successful

Robert Reif reif at earthlink.net
Wed Apr 5 18:14:32 CDT 2006


Don't call arts_free if arts_init wasn't successful.
-------------- next part --------------
Index: dlls/winmm/winearts/audio.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winearts/audio.c,v
retrieving revision 1.33
diff -p -u -r1.33 audio.c
--- dlls/winmm/winearts/audio.c	23 Jan 2006 16:47:18 -0000	1.33
+++ dlls/winmm/winearts/audio.c	5 Apr 2006 23:06:04 -0000
@@ -202,6 +202,7 @@ typedef struct {
     ARTS_MSG_RING		msgRing;
 } WINE_WAVEIN;
 
+static BOOL		init;
 static WINE_WAVEOUT	WOutDev   [MAX_WAVEOUTDRV];
 static WINE_WAVEIN	WInDev    [MAX_WAVEINDRV];
 
@@ -380,7 +381,8 @@ LONG		ARTS_WaveClose(void)
       }
     }
 
-    arts_free();    /* free up arts */
+    if (init)
+        arts_free();    /* free up arts */
     return 1;
 }
 
@@ -415,6 +417,8 @@ LONG ARTS_WaveInit(void)
     if (ret)
         return ret;
 
+    init = TRUE;
+
     /* initialize all device handles to -1 */
     for (i = 0; i < MAX_WAVEOUTDRV; ++i)
     {


More information about the wine-patches mailing list