changeset 457:8433a117784f

6950553: Applet: IE process crash in OLE32.DLL when playing a sound Reviewed-by: poonam
author amenkov
date Tue, 02 Nov 2010 15:19:35 +0300
parents 2ea7a84adb54
children 5672a2be515a
files make/javax/sound/jsoundds/Makefile src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/javax/sound/jsoundds/Makefile	Tue Oct 26 16:47:09 2010 +0100
+++ b/make/javax/sound/jsoundds/Makefile	Tue Nov 02 15:19:35 2010 +0300
@@ -52,7 +52,7 @@
 #
 # Extra cc/linker flags.
 #
-LDLIBS += dsound.lib winmm.lib user32.lib
+LDLIBS += dsound.lib winmm.lib user32.lib ole32.lib
 CPPFLAGS += \
 	-DUSE_DAUDIO=TRUE \
 	-I$(SHARE_SRC)/native/com/sun/media/sound \
--- a/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp	Tue Oct 26 16:47:09 2010 +0100
+++ b/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp	Tue Nov 02 15:19:35 2010 +0300
@@ -476,6 +476,7 @@
 
 DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param)
 {
+    ::CoInitialize(NULL);
     while (1) {
         // wait for something to do
         ::WaitForSingleObject(data.startEvent, INFINITE);
@@ -492,6 +493,7 @@
         }
         ::SetEvent(data.startedEvent);
     }
+    ::CoUninitialize();
     return 0;
 }