Skip to content

RenderColorMesh memory leak hint? #2

@gailweiss

Description

@gailweiss

[I am not familiar with github commenting protocol]

If you are still maintaining this code, I hope this will be of some help:

The memory leak in RenderColorMesh may be coming from improper release of the OffScreenGL created in the function.

A temporary workaround can be achieved by replacing the lines:

===================
OffscreenGL offscreenGL((int)(imgSizeV[0] * zoomFactor), (int) (imgSizeV[1] * zoomFactor));
int output3Size[3];

unsigned char *imgBuffer;

if (offscreenGL.RGB8Setup()) {

mexPrintf("OpenGLCanvas setup Successful\n");

with the lines

static OffscreenGL offscreenGL((int)(imgSizeV[0] * zoomFactor), (int) (imgSizeV[1] * zoomFactor));
static bool not_first_entry = false;
int output3Size[3];

unsigned char *imgBuffer;

if (not_first_entry || offscreenGL.RGB8Setup()) {
if(!not_first_entry){
mexPrintf("OpenGLCanvas setup Successful\n");
}

not_first_entry=true;

this stems the leak, though it does not fix it (X11 continues to run in the background and eventually crash if called unexpectedly)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions