From d7ee5068483f1a855c3b8d107d2c241f4d0ddf49 Mon Sep 17 00:00:00 2001 From: amenkov Date: Tue, 2 Nov 2010 14:59:39 +0300 Subject: [PATCH] 6950553: Applet: IE process crash in OLE32.DLL when playing a sound Reviewed-by: poonam --- make/javax/sound/jsoundds/Makefile | 2 +- .../com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/make/javax/sound/jsoundds/Makefile b/make/javax/sound/jsoundds/Makefile index 178212437..e38a98535 100644 --- a/make/javax/sound/jsoundds/Makefile +++ b/make/javax/sound/jsoundds/Makefile @@ -53,7 +53,7 @@ FILES_export = \ # # 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 \ diff --git a/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp b/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp index e17de1b87..5b80dd00e 100644 --- a/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp +++ b/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp @@ -476,6 +476,7 @@ DS_StartBufferHelper::Data::~Data() { 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 @@ DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param) } ::SetEvent(data.startedEvent); } + ::CoUninitialize(); return 0; } -- GitLab