Structure I created:
struct VideoSample
{
const unsigned char * buffer;
int len;
};
VideoSample * newVideoSample = new VideoSample;
To Allocate -> VideoSample * newVideoSample = new VideoSample;
To Delete -> delete newVideoSample;
If you deleting the object in the same context, you better just allocate it on the stack. If you deleting it outside the context don't forget to pass a reference.
And most important, don't delete if your about to exit process, it's pointless :P