[mythtv] delete vs delete[] in dvbrecorder destructor

John Pullan jmp at tarantella.com
Tue Feb 22 11:52:41 UTC 2005


These should be delete[]'s 

On Tue, 2005-02-22 at 19:15 +0800, Tj wrote:
> 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.
> 
> 
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev



More information about the mythtv-dev mailing list