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.