- Oct 24, 2015
- Reaction score
Well what you're experiencing is consistent with how "garbage collection" works, where the resource is "free"'d up because it thinks it's no longer in use, but that shouldn't be happening unless the object is "deleted" which should only be happening when it encounters the "erase". It's possible that maybe without the "wait" it's sometimes running ahead of itself and erasing picture 2/3/4/5 before it's actually displayed it. As it is, you actually should be "wait"ing at least 1/60th of a second (eg 1 frame) to show the picture otherwise you're relying on the display speed which may be asynchronous to the actual file i/o.Well, the thing that I don't understand is that sometimes the event showing the picture works correctly, sometimes it makes the game crashes. So not only do the images exist and are correctly named, but most of the time, the game reads them normally. There's a small percentage of times (maybe like 10%?) that I get the bug.