[mythtv] delete vs delete[] in dvbrecorder destructor

Tj htpc at treblid.dyndns.org
Tue Feb 22 11:15:59 UTC 2005


Dear folks,

In the destructor of DVBRecorder (mythtv/libs/libmythtv/dvbrecorder.cpp:92)
----
DVBRecorder::~DVBRecorder()
{
    if (_stream_fd >= 0)
        Close();

    if (_buffer)
        delete[] _buffer;

    delete pat_pkt;
    delete pmt_pkt;
}
----
Is there a difference between delete and delete[]? I think there is by 
definition but not sure if it's applicable in practice, or to the 
'uint8_t' datatype.

All three variables are allocated using new, so should pat_pkt and 
pmt_pkt use delete[] instead, as _buffer is?



Regards.





More information about the mythtv-dev mailing list