Weird Null Object Error in Max2d

BlitzMax Forums/BlitzMax Programming/Weird Null Object Error in Max2d

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This is probably going to be one of those, "Well I cannot reproduce it" problems.

Every now and then on a build, I get a Null object error on setOrigin. (Its probably on setorigin because its the first graphics command)
Then if I rebuild the project, (or if I just re-run the project), I dont get the error.

The program is using a window/canvas which is definatly being created before anycalls to it. (Rather I am definatly telling it to be created before anycalls to it)

What I think the problem is, is that the creation of the canvas is being "Queued" and somtimes it is created before calls to it, and sometimes not.

I dont expect a patch solution from you, as I am being very vauge about the problem. But any hints on what it might be that I am doing that would make this happen or how to stop it, would be appreachiated.

Obviously the insertion of a delay somewhere would help, but Im using one of those Mono/self creation types (Where the creation code is in global Fields), and there isnt a place to put a delay

(If you think this should be in Programming, then please move it)