Skip to content

Calling delete on the frame in OnNewFrame() causes null ptr dereference in msvc runtime. When and how to free frames? #353

@chipweinberger

Description

@chipweinberger

How and when do we release frames? Doing this causes null ptr dereference =(
My listener looks like this:

bool PipedListener::onNewFrame(Frame::Type typ, Frame *f){

HANDLE pipe;
DWORD byte_width = f->width * f->height * f->bytes_per_pixel;

switch (typ){
case Frame::Type::Color:
    pipe = color_pipe;
    break;
case Frame::Type::Depth:
    pipe = depth_pipe;
    break;
default:
    return true;
}


DWORD bytes_written;
WriteFile(
    pipe, //hFile,
    f->data,//lpBuffer,
    byte_width,
    &bytes_written, //lpNumberOfBytesWritten,
    NULL //lpOverlapped
    );

//delete f;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions