6950553: Applet: IE process crash in OLE32.DLL when playing a sound
authoramenkov
Tue, 02 Nov 2010 14:59:39 +0300
changeset 7015 7fe7dbe02025
parent 7013 6af860e04527
child 7016 dfcd29232e40
6950553: Applet: IE process crash in OLE32.DLL when playing a sound Reviewed-by: poonam
jdk/make/javax/sound/jsoundds/Makefile
jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp
--- a/jdk/make/javax/sound/jsoundds/Makefile	Tue Nov 02 15:08:56 2010 +0900
+++ b/jdk/make/javax/sound/jsoundds/Makefile	Tue Nov 02 14:59:39 2010 +0300
@@ -53,7 +53,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/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp	Tue Nov 02 15:08:56 2010 +0900
+++ b/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp	Tue Nov 02 14:59:39 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;
 }