Run this in debug mode, and it correctly catches the lack of camera/cube on MoveEntity. Uncomment the two REM'd lines, and it neither crashes nor gives a debug error, despite the fact that the handles are still supposedly pointing to nothing!
Graphics3D 640, 480
cam = CreateCamera ()
FreeEntity cam
;CreateCamera ()
MoveEntity cam, 0, 0, 0
cube = CreateCube ()
FreeEntity cube
;CreateCube ()
MoveEntity cube, 0, 0, 0
End
Thinking about it, I guess the new entities get created at the old handle addresses by chance, so maybe more of a 'quirk' than a bug, since handles aren't zeroed by design... ?
|