The CVI7.0 application crashes with FATAL RUN-TIME ERROR when the GRAPH control is programmed. The code which makes the error is:
InsertAxisItem (timepanel, TIMEPANEL_GRAPH, VAL_BOTTOM_XAXIS, i, pAxisLabel[i], pAxisItemValue[i]-nStartIndex);
FATAL RUN-TIME ERROR: "TimeWave.c", line 216, col 9, thread id 0x00000F60: The program has caused a 'General Protection' fault at 001B:685C08B3.
I found the pointers of pAxisLabel and pAxisItemValue were unexpectedly freed! They were just allocated space few lines before. This part of code runs well most of the time.
Another line of code which makes FATAL RUN-TIME ERROR is also programming the GRAPH control.
SetAxisScalingMode (timepanel, TIMEPANEL_GRAPH, VAL_BOTTOM_XAXIS, nScaleMode, 0.0, (double)(lnSize-1));
and the error message is:
FATAL RUN-TIME ERROR: "TimeWave.c", line 200, col 5, thread id 0x00000B78: The program has caused a 'General Protection' fault at 001B:685C08B3.
I debuged the application and ran it step by step. I found that the app crashed when executing the code above, sometimes a global pointer was unexpectedly freed, sometimes the pointer was normal and no further clue was found.
This error doesn't happen consistently. When I debuged the application and ran it step by step, this error usually doesn't happen. But when the application run automatically, the error happens.
Thanks.
ZSW