GRAPH free allocated memory problem.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • GRAPH free allocated memory problem.

    I saw a thread from Ana, with same problem.
    When I delete a window that has a GRAPH object, I get the message "gui_alloc.c: block to be deleted is already locked in free()".
    I get this message 2 times, (when I attach 2 graph data, number of times is number of attached data objects) just before the window is deleted:



    h24Data = GRAPH_DATA_XY_Create(GUI_RED,25,d24Points,25);
    h24Data1 = GRAPH_DATA_XY_Create(GUI_GREEN,25,d24Points1,25);
    GRAPH_AttachData(hItem,h24Data);
    GRAPH_AttachData(hItem,h24Data1);


    Whoever, if I manually detach the data, and delete it, there is no problem:
    hItem = WM_GetDialogItem(pMsg->hWin, ID_GRAPH_0);
    GRAPH_DetachData(hItem,h24Data);
    GRAPH_DetachData(hItem,h24Data1);
    GRAPH_DATA_XY_Delete(h24Data);
    GRAPH_DATA_XY_Delete(h24Data1);
    // now no error message box is poped:
    WM_DeleteWindow(mainW);



    This workaround works, but why is it needed?


    Regards
    Johanan