Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » How does widget/variable destruction in U++ work?
How does widget/variable destruction in U++ work? [message #38357] Wed, 12 December 2012 10:53 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
I am working on a program to manage movies on my computer. I have already built a lot, and I am testing all the time, also on memory usage. Now a question came to me. I use task manager to find out which actions take up memory, but I notice that when I execute a block as following:

void MovieManager::Options()
{
	SettingsDialog().Execute();
}


Which creates an instance of my settings dialog form, the memory usage increases by 600 KB. This is not weird, since I have a lot of controls, loading code and images inside there. However, when I close the dialog again by using:

Close();


The 600 KB memory that has been eaten is not being freed. Logically using C++ this way, the SettingsDialog variable that I created inside the function is destroyed as soon as the function finishes, and the used memory is freed.

Now I know that task manager is not the greatest tool to monitor memory usage as it is not quite as accurate as it should be. But this situation certainly brought up the question to me as it were: How does variable destruction and memory releasing work in U++?
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is there a Zip/UnZip example?
Next Topic: GuiLock when creating widgets
Goto Forum:
  


Current Time: Fri Apr 26 11:55:29 CEST 2024

Total time taken to generate the page: 0.06926 seconds