Max crashes after a while!

BlitzMax Forums/BlitzMax Programming/Max crashes after a while!

I think I might have possibly found the problem. Won't know for sure until I do some testing. In the module brlmod/eventqueue.mod/eventqueue.bmx there are two variables that keep track of the queue. queue_put and queue_get. The first keeps track of where the next event is placed in the queue and the second controls where the next event is to be read, creating a FIFO queue of events. Now the variables are incremented each time one of the poll events are called (pollevent, waitevent, peekevent, etc...) the next space on the queue is determined through masking with 255, basically doing a fast queue_get Mod 256, so it will always point somewhere within a queue array. Problem is that these variables are only incremented and never decremented. Eventually they will overflow and become negative. When that happens, basically the queue will start to be read backwards instead of forward, in theory that is, wont know for sure until I do some tests.
The solution to the problem is whenever the queue is empty, to reset both pointers to 0. So I did a find for queue_get=queue_put and put the lines
queue_get = 0
queue_put = 0
immediately after. Now I'll go ahead and let a program run overnight and see if it's crashed in the morning.