Confusion of memory management with Locals

BlitzMax Forums/BlitzMax Programming/Confusion of memory management with Locals

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.

Okay.

Just to make sure I'm not nuts or making it up, I re-compiled it here again, with and without debug, and it continues to exhibit the same behavior.

When I create Local TestPX:TPixmap the DrawPixmap command which should display it on the screen, actually display a black/empty pixmap. I drew a white rect behind it and it does blit the pixmap, it's just black rather than the image.

When I change it to Global TestPX:TPixmap the image, as loaded, appears.

In both instances, the same files are being loaded with the same routines.

Now, when I remove both of the FlushMem's, the program works correctly. Question is, why does flushmem cause the image to not be loaded correctly? the pixmap is stored in the FromPixmap field before flushing, so it should still be retained.


Ideas?