Posted By: alibaba
[LBGUI] Memory not released! - 04/26/15 15:40
Some elements seem not to get released when deleted. I canīt find the leak. Any ideas?
Here is a test script (open it in the lbgui directory):
Here is a test script (open it in the lbgui directory):
Code:
#include <acknex.h> #include <default.c> #include "lbgui.h" BMAP* editbox_left_tga = "editbox_left.tga"; BMAP* editbox_middle_tga = "editbox_middle.tga"; BMAP* editbox_right_tga = "editbox_right.tga"; void create() { LBG_create_editbox (0, 64, 320, 256, 16, 4, "Editbox", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW); LBG_create_editbox (0, 64, 320, 256, 16, 4, "Editbox", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW); LBG_create_editbox (0, 64, 320, 256, 16, 4, "Editbox", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW); LBG_create_editbox (0, 64, 320, 256, 16, 4, "Editbox", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW); LBG_create_editbox (0, 64, 320, 256, 16, 4, "Editbox", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW); LBG_create_editbox (0, 64, 320, 256, 16, 4, "Editbox", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW); LBG_create_editbox (0, 64, 320, 256, 16, 4, "Editbox", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW); } void release() { LBG_EDITBOX* ebx = LBG_EDITBOX_FIRST; while(ebx) { ebx = LBG_destroy_editbox(ebx); } } void main() { wait(1); LBGUI_open(); // Open the GUI on_exit = LBGUI_close; // Close it when the application is terminated LBG_flags |= LBGUI_PROTECTMOUSE; // This prevents windows to be moves outside the engine window on_k=create; on_l=release; }