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 » TreeCtrl » A [TreeCtrl] bug
Re: A [TreeCtrl] bug [message #14608 is a reply to message #14595] Tue, 04 March 2008 15:20 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
mrjt wrote on Tue, 04 March 2008 07:16


I believe this is because both key and value are Value types that may contain reference-counted objects (such as Image), and setting Null is required to decrement this count and (perhaps) free the memory. So setting Null is can be the cause of memory release.



Right on the spot... This is only minor optimization, but we want to consume as little memory as possible, right?

Quote:


But if this is the case then surely 'key = Null' should be added?



Definitely! It was added too.

Quote:


I admit it's unlikely that a reference counted object would be used as a Key



It is Value, so it is always reference counted... (I am considering to introduce "small value optimization", but numbers do not seem to match....)

Quote:


I could be wrong about all this though, my understanding of this aspect of Upp is somewhat limited.



Your understanding is near to perfect, as usual Wink

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FIX - Single Click does not open/close items
Next Topic: problem in Refreshing at end of tree
Goto Forum:
  


Current Time: Sun May 12 07:12:28 CEST 2024

Total time taken to generate the page: 0.02736 seconds