Initialize the vars and make sure we 'NULL' them after we free them.
On HP (for example) there isn't a sound shared lib, so we ended up freeing an uninitialized pointer. r= dougt@netscape.com git-svn-id: svn://10.0.0.236/trunk@65717 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -86,6 +86,10 @@ nsSound::nsSound()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInited = PR_FALSE;
|
||||
|
||||
mPlayBuf = NULL;
|
||||
mBuffer = NULL;
|
||||
mBufferSize = 0;
|
||||
}
|
||||
|
||||
nsSound::~nsSound()
|
||||
@@ -98,10 +102,8 @@ nsSound::~nsSound()
|
||||
(*EsdClose)(esdref);
|
||||
esdref = -1;
|
||||
}
|
||||
if (mPlayBuf)
|
||||
PR_Free( mPlayBuf );
|
||||
if (mBuffer)
|
||||
PR_Free( mBuffer );
|
||||
PR_FREEIF( mPlayBuf );
|
||||
PR_FREEIF( mBuffer );
|
||||
mInited = PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user