Solved graphics resources not updated or corrupted when loaded in a thread (#411)