Jump to content

Memory leak?


Yue
 Share

Go to solution Solved by Yue,

Recommended Posts

 

This is really confusing, it must be my C++ programming that I am learning. But it is really strange that someone is doing well and someone is not. 

My theory is that it is exclusively when hiding a panel.  Now what I would have to do is to rebuild the whole project and evaluate what is happening. I don't see any other way. 

 

 

 

Link to comment
Share on other sites

 

At this point I have implemented the GUI prototype, and it is stable although in the main loop it hides the panel.

image.thumb.png.d24c43113d5396ddd3cfe3ee61a895d3.png

 

#include "Leadwerks.h"
#include "CWindow.h"
#include "CInput.h"
#include "CWorld.h"
#include "CDraw.h"

using namespace Leadwerks;

int main(int argc, const char *argv[])
{
	CWindow window;
	CInput input;

	//Context* context = Context::Create(window.Get());
	CDraw draw(window.Get());


	
	CWorld world;
	Camera* cam = Camera::Create();
	
	
	GUI* gui = GUI::Create(draw.Get());
	Widget* base = gui->GetBase();

	Widget*  pnl = Widget::Panel(200, 100, 200, 200, base);

	

	while (!window.GetClosed())
	{
		if ( input.GetKeyUp(Key::Escape)) return false;

		pnl->Hide();
		
		Time::Update();
		world.Update();
		world.Render();
	
	

		draw.InfoDebug();
		draw.Update();

	}
	return 0;


}

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...