Inserting Null into a TMap causes random crashes

BlitzMax Forums/BlitzMax Programming/Inserting Null into a TMap causes random crashes

JoshK(Posted 2008) [#1]
I think TMaps should treat an insertion as a removal if the value is Null, and nothing should be done if the key is Null. Or at least an error should be generated. As it is right now, doing this will cause random memory errors.


JoshK(Posted 2008) [#2]
Then a runtime error should be generated, at least in debug mode. It is easy to accidentally have a variable set to Null, and then use that in a TMap.

The "random memory errors" I am talking about aren't your normal code errors...These are random crashes on lines like "New TList" or other code totally unrelated to TMaps. The only time I have seen errors like this is when some memory is being overwritten outside the normal GC.

What happened to your reply??


Brucey(Posted 2008) [#3]
Absolutely.


ziggy(Posted 2008) [#4]
Shouldn't this be post as a bug report? It seems an stability issue to me


GfK(Posted 2008) [#5]
I'm sure that the "null objects in tmaps" thing has been posted in bug reports at least twice already, to my knowledge.


plash(Posted 2008) [#6]
Even if it is fixed *now* we will still have to wait for the next version to see it. Sure, we can hax it in-place, but not everyone likes to do that to the official modules (I'm up for it!)