question about ColibriGui's sample leak

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


knn217
Halfling
Posts: 78
Joined: Wed Jan 25, 2023 9:04 am
x 5

question about ColibriGui's sample leak

Post by knn217 »

hello, I saw that ColibriGui's sample has leaks issue on the github page. After checking the code I think its layout, layoutW, layoutOverlapping that aren't deleted in destroyScene01.

Are these the only leaks? I'm trying to implement ColibriGui in my project so I want to make sure there are no leaks first.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5476
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1358

Re: question about ColibriGui's sample leak

Post by dark_sylinc »

Hi!

Yes. Colibri's internals don't leak (if you find a leak, please report it!).

But the sample itself never tries to destroy the root windows (destroying the root windows will cascade intro destroying all children windows and widgets), nor tries to set all ptrs to nullptr (i.e. since destroying a window destroys all its children, all pointers you have over those children will become dangling).

knn217
Halfling
Posts: 78
Joined: Wed Jan 25, 2023 9:04 am
x 5

Re: question about ColibriGui's sample leak

Post by knn217 »

dark_sylinc wrote: Mon Aug 21, 2023 4:09 pm

But the sample itself never tries to destroy the root windows

By root windows did you mean "fullWindow", "mainWindow" and "vertWindow"? since I thought they were deleted when graphicsSystem called the gamestate's DestroyScene():

Code: Select all

void ColibriGuiGameState::destroyScene()
	{
		colibriManager->destroyWindow( fullWindow );
		colibriManager->destroyWindow( mainWindow );
		colibriManager->destroyWindow( vertWindow );
		colibriManager->destroyWindow( overlapWindow1 );
		colibriManager->destroyWindow( overlapWindow2 );
		delete demoActionListener;
		delete colibriManager;
	}