Handles

BlitzMax Forums/BlitzMax Programming/Handles

Czar Flavius(Posted 2011) [#1]
HandleFromObject/HandleToObject

Do they have any use in a serious project?


beanage(Posted 2011) [#2]
Maybe in some rare fictional cases.. I guess they are used internally in none-strict mode.


Htbaa(Posted 2011) [#3]
Strict mode hasn't got anything to do with these 2 functions really.

Only time I used them was when experimenting with modifying BlitzMax objects from within Lua. The "downside" with using these functions is that when you're done with the objects you converted to a Handle you need to free them yourself. The garbage collector won't do that for you.


Czar Flavius(Posted 2011) [#4]
Can you use handles and standard references to an object at the same time? I've done some experimenting and it seems that an object isn't collected when released, if you have normal references too. All handles and normal references need to be removed.


Htbaa(Posted 2011) [#5]
That I don't know. I guess you could make a little test-case to check that out.