Structure I created:
struct VideoSample { const unsigned char * buffer; int len; }; VideoSample * newVideoSample = new VideoSample;
delete newVideoSample;
But if the new and delete are in the same context, you're probably better off skipping them and just creating it on the stack instead:
new
delete
VideoSample newVideoSample = {buf, size};
In that case, no cleanup is necessary.