Assume:
LPDIRECTSOUNDCAPTURE m_pDSCapture;
LPDIRECTSOUNDCAPTUREBUFFER m_pDSBCapture;
LPDIRECTSOUNDNOTIFY m_pDSNotify;
When my thread exits, I call
m_pDSBCapture->Stop();
then
SAFE_RELEASE( m_pDSNotify );
SAFE_RELEASE( m_pDSBCapture );
SAFE_RELEASE( m_pDSCapture );
but the call to
SAFE_RELEASE( m_pDSBCapture );
crashes with the following stack trace below it.
ntdll.dll!@RtlpLowFragHeapFree@8() + 0x2c bytes
ntdll.dll!_RtlFreeHeap@12() + 0x7a bytes
kernel32.dll!_HeapFree@12() + 0x14 bytes
dsound.dll!_MemFreeBuffer@4() + 0x16 bytes
dsound.dll!CSysMemBuffer::~CSysMemBuffer() + 0x36 bytes
dsound.dll!CSysMemBuffer::`vector deleting destructor'() + 0xd bytes
dsound.dll!CDsBasicRuntime::Release() + 0x25 bytes
dsound.dll!CCaptureWaveBuffer::~CCaptureWaveBuffer() + 0x27 bytes
dsound.dll!CEmCaptureWaveBuffer::~CEmCaptureWaveBuffer() + 0x13a bytes
dsound.dll!CEmCaptureWaveBuffer::`vector deleting destructor'() + 0xd
bytes
dsound.dll!CDsBasicRuntime::Release() + 0x25 bytes
dsound.dll!CDirectSoundCaptureBuffer::~CDirectSoundCaptureBuffer() + 0x4a
bytes
dsound.dll!CDirectSoundCaptureBuffer::`scalar deleting destructor'() +
0xd bytes
dsound.dll!CDsBasicRuntime::Release() + 0x25 bytes
dsound.dll!CImpUnknown::Release() + 0x38 bytes
dsound.dll!CImpSinkRefClock::Release() + 0x11 bytes
This crash only seems to happen though when I put my system to sleep. when
it wakes up, it appears to continue to capture correctly, but fails when I
try to clean up.
Here's the output from dxdiag about my sound card:
-------------
Sound Devices
-------------
Description: Speakers / Headphones (SigmaTel High Definition
Audio CODEC)
Default Sound Playback: Yes
Default Voice Playback: Yes
Hardware ID:
HDAUDIO\FUNC_01&VEN_8384&DEV_7690&SUBSYS_102801D8&REV_1022
Manufacturer ID: 1
Product ID: 100
Type: WDM
Driver Name: stwrt.sys
Driver Version: 6.10.5614.0000 (English)
Driver Attributes: Final Retail
WHQL Logo'd: n/a
Date and Size: 9/13/2007 14:46:06, 330240 bytes
Other Files:
Driver Provider: SigmaTel
HW Accel Level: Basic
Cap Flags: 0x0
Min/Max Sample Rate: 0, 0
Static/Strm HW Mix Bufs: 0, 0
Static/Strm HW 3D Bufs: 0, 0
HW Memory: 0
Voice Management: No
EAX(tm) 2.0 Listen/Src: No, No
I3DL2(tm) Listen/Src: No, No
Sensaura(tm) ZoomFX(tm): No
---------------------
Sound Capture Devices
---------------------
Description: Microphone / Line In (SigmaTel High Definition
Audio CODEC)
Default Sound Capture: Yes
Default Voice Capture: Yes
Driver Name: stwrt.sys
Driver Version: 6.10.5614.0000 (English)
Driver Attributes: Final Retail
Date and Size: 9/13/2007 14:46:06, 330240 bytes
Cap Flags: 0x0
Format Flags: 0x0
Anyone have any suggestions?
Anthony Wieser
> My program seems to crash when I try to clean up direct sound.
...
>
> Anyone have any suggestions?
Is there any other information in the debug output? It appears to be
something with the heap memory and it should tell you if the heap is
corrupt or that memory was modified after it was freed, etc.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
Just the access violation address.
Here's the contents of the output window:
First-chance exception at 0x770e59c3 (ntdll.dll) in _demo.exe: 0xC0000005:
Access violation reading location 0xb260ec3f.
Unhandled exception at 0x770e59c3 (ntdll.dll) in _demo.exe: 0xC0000005:
Access violation reading location 0xb260ec3f.
Anthony Wieser
Wieser Software Ltd
"Anthony Wieser" <newsgroup...@wieser-software.com> wrote in message
news:%233%23Bvu0E...@TK2MSFTNGP03.phx.gbl...