Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
it ran well before i close it ,the error happened ,
the error is that
VB
NTDLL! 7c92120e()
NTDLL! 7c97f924()
NTDLL! 7c98f247()
NTDLL! 7c98302c()
KERNEL32! 7c85f9a7()
_CrtIsValidHeapPointer(const void * 0x01b22908) line 1697
_free_dbg_lk(void * 0x01b22908, int 1) line 1044 + 9 bytes
_free_dbg(void * 0x01b22908, int 1) line 1001 + 13 bytes
operator delete(void * 0x01b22908) line 49 + 16 bytes
CMyX264Decode::`scalar deleting destructor'(unsigned int 1) + 56 bytes
VIDEO_Decode_StopDecompress(void * & 0x01b22908) line 319 + 32 bytes
HGRENDER! 00cfb64b()
HGRENDER! 00cfe6a7()
HGRENDER! 00cf60ac()
CVideoRemote::StopPreview() line 168
CMediaControl::StopRecvVideo(unsigned short 20496) line 328 + 13 bytes
HAOHUIYI! 004a00ce()
HAOHUIYI! 0049c371()
HGCONFDLL! 00ca5f15()




i think the error is when i use delete.but i can not solve it
C#
if( hDecoder )
    {
        CVideoDecoder *pDecoder = (CVideoDecoder *)hDecoder;
        pDecoder->StopDecompress();
        if (pDecoder)
        {
            delete pDecoder ;
            pDecoder = NULL ;
        }
        /*delete pDecoder;*/
        hDecoder = NULL;
    }


does anyone can give me some suggestion ?
best regard !
Posted
Comments
Jochen Arndt 2-May-13 6:00am    
You are casting a handle value (hDecoder) to a pointer to a class (CVideoDecoder). This will not work. With handles, there is usually some kind of close() function.

But without knowing about the handle type and the CVideoDecoder class, it is difficult to answer.
chinahyin 2-May-13 6:02am    
StopDecompress(); is the close()function, thank you for your suggestions
Jochen Arndt 2-May-13 6:15am    
But the name hDecoder implies that it is a handle. So I would expect a function like StopDecompress(hDecoder).

You should tell us at least the kind of hDecoder and if there is some kind of implicit conversion to the CVideoDecoder class. If not, your code will not work.
Also you are using pDecoder without checking if it is NULL. So even when you can cast hDecoder to CVideoDecoder*, it should be:
if (pDecoder)
{
pDecoder->StopDecompress();
// ...
}
chinahyin 2-May-13 6:22am    
you are so kind thank you for your help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900