[LBGUI] Memory not released!

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):

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;
}

Posted By: alibaba

Re: [LBGUI] Memory not released! - 05/02/15 14:16

Anyone?
Posted By: DLively

Re: [LBGUI] Memory not released! - 05/02/15 14:35

whats being released, whats not?
Posted By: alibaba

Re: [LBGUI] Memory not released! - 05/02/15 14:37

Nevermind, after a week of fiddeling around I finally found the problem. He forgot to release bitmaps he created during runtime. In all of the elements. Had to go through thousands lines of code.. what a waste of time!
Posted By: 3run

Re: [LBGUI] Memory not released! - 05/02/15 14:41

Originally Posted By: alibaba
Nevermind, after a week of fiddeling around I finally found the problem. He forgot to release bitmaps he created during runtime. In all of the elements. Had to go through thousands lines of code.. what a waste of time!
That sucks.. frown Maybe you could reupload fixed version in original thread, so no one will need to fix this again?
Posted By: alibaba

Re: [LBGUI] Memory not released! - 05/02/15 19:48

Originally Posted By: 3run
Originally Posted By: alibaba
Nevermind, after a week of fiddeling around I finally found the problem. He forgot to release bitmaps he created during runtime. In all of the elements. Had to go through thousands lines of code.. what a waste of time!
That sucks.. frown Maybe you could reupload fixed version in original thread, so no one will need to fix this again?


Yeah I will, just need to get rid of some small leaks. They are only seen when using LBGUI intensively.
Posted By: alibaba

Re: [LBGUI] Memory not released! - 05/02/15 20:52

Here is the fixed version without memory leaks:
http://skytitans.de/lbgui.h
Posted By: Kartoffel

Re: [LBGUI] Memory not released! - 05/22/18 19:58

do you still happen to have the fixed version of lbgui? laugh
Posted By: Evo

Re: [LBGUI] Memory not released! - 05/22/18 20:40

I would also like to have a fixed copy of lbgui if possible.

Alibaba : your private messages are full and I can't send a PM to you on the forum. I sent an email to you about a private beta project and help with beta testing. If you're interested, send me a reply by email. Thanks.
Posted By: alibaba

Re: [LBGUI] Memory not released! - 05/23/18 00:11

I'll see if I can find it. I'm sure I have it somewhere on my old HDD.
Posted By: alibaba

Re: [LBGUI] Memory not released! - 05/23/18 14:28

Here you go: http://yueklet.de/lbgui.h
Posted By: Kartoffel

Re: [LBGUI] Memory not released! - 05/23/18 14:47

awesome, thanks a lot alibaba.

edit: damn, there's a quite a few lines that rely on lite-c pointer conversions :[
but it shouldn't take me too long to correct those
Posted By: Evo

Re: [LBGUI] Memory not released! - 05/23/18 20:39

Thanks, Alibaba.
© 2024 lite-C Forums