Okay, I think I have stabilized it. I have been calling the following line in the while loop:

Quote:
scan_bmp = bmap_for_entity(my,1);


But it looks like it only needs to be called once when the view is created. In any case, it seems to work, and has not crashed after a long play session.