mirror of
https://github.com/mpromonet/v4l2rtspserver
synced 2024-11-19 15:25:34 +00:00
replace delete with delete[]
This commit is contained in:
parent
4b23730e86
commit
0521316285
@ -36,6 +36,8 @@ class V4L2DeviceSource: public FramedSource
|
||||
struct Frame
|
||||
{
|
||||
Frame(char* buffer, int size, timeval timestamp) : m_buffer(buffer), m_size(size), m_timestamp(timestamp) {};
|
||||
Frame(const Frame&);
|
||||
Frame& operator=(const Frame&);
|
||||
~Frame() { delete m_buffer; };
|
||||
|
||||
char* m_buffer;
|
||||
|
@ -149,7 +149,7 @@ void V4L2DeviceSource::deliverFrame()
|
||||
}
|
||||
fFrameSize -= offset;
|
||||
memcpy(fTo, frame->m_buffer+offset, fFrameSize);
|
||||
delete frame;
|
||||
delete [] frame;
|
||||
}
|
||||
|
||||
// send Frame to the consumer
|
||||
@ -168,13 +168,13 @@ void V4L2DeviceSource::getNextFrame()
|
||||
if (frameSize < 0)
|
||||
{
|
||||
envir() << "V4L2DeviceSource::getNextFrame errno:" << errno << " " << strerror(errno) << "\n";
|
||||
delete buffer;
|
||||
delete [] buffer;
|
||||
handleClosure(this);
|
||||
}
|
||||
else if (frameSize == 0)
|
||||
{
|
||||
envir() << "V4L2DeviceSource::getNextFrame no data errno:" << errno << " " << strerror(errno) << "\n";
|
||||
delete buffer;
|
||||
delete [] buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -192,6 +192,10 @@ void V4L2DeviceSource::getNextFrame()
|
||||
{
|
||||
queueFrame(buffer,frameSize,ref);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete [] buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,7 +267,6 @@ bool V4L2DeviceSource::processConfigrationFrame(char * frame, int frameSize)
|
||||
std::cout << "AuxLine:" << m_auxLine << " \n";
|
||||
}
|
||||
ret = true;
|
||||
delete [] frame;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user