Hello,
I wrote the attached codes to output a string by activating the memory device function of emwin lib.
This code seemed to work well, but as I tested it a few times, the hMem handle value returned from GUI_MEMDEV_CreateEx, began to increase at some point, and then from a moment it was out of control as if it was running out of memory and output went mess. Can someone tell me what caused this symptom?
FYI, the function created below confirmed that GUI_MEMDEV_CreateEx() and GUI_MEMDEV_Delete() are always executed together. I thought that the memory should be released after gui_memdev_delete(), but it did not seem to be released. Symptom is like this. hMem value is increasing from some moment.
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 5
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 6
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 5
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 6
.....
...
//did some other things in the setting ui.
...
..
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 7
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 4
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 7
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 4
.....
...
//did some other things in the setting ui.
...
..
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 9
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 10
...
.....
...
//did some other things in the setting ui.
...
..
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 11
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 12
.........
Have you seen any similar symptoms?
Best Regards,
Tommy Lim
I wrote the attached codes to output a string by activating the memory device function of emwin lib.
This code seemed to work well, but as I tested it a few times, the hMem handle value returned from GUI_MEMDEV_CreateEx, began to increase at some point, and then from a moment it was out of control as if it was running out of memory and output went mess. Can someone tell me what caused this symptom?
FYI, the function created below confirmed that GUI_MEMDEV_CreateEx() and GUI_MEMDEV_Delete() are always executed together. I thought that the memory should be released after gui_memdev_delete(), but it did not seem to be released. Symptom is like this. hMem value is increasing from some moment.
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 5
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 6
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 5
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 6
.....
...
//did some other things in the setting ui.
...
..
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 7
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 4
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 7
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 4
.....
...
//did some other things in the setting ui.
...
..
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 9
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 10
...
.....
...
//did some other things in the setting ui.
...
..
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 11
hMem = GUI_MEMDEV_CreateEx(...)
//do gui_disp_string()
GUI_MEMDEV_Delete(hMem) // hMem = 12
.........
Have you seen any similar symptoms?
Best Regards,
Tommy Lim