1.1 KiB
1.1 KiB
Tileset, and all other objects accessible through it (such as Tile instances), may generally only be used from one thread at a time. There are some very limited exceptions.
Tile::getState()may be called at any time and from any thread.- When a tile is in the
LoadState::ContentLoadingstate, a separate load thread may callgetState,setState, andgetContent. It may also set_pRendererResources.
Tileset shut down process, initiated from the game thread:
- For tiles in any state other than
ContentLoading, just unload it (no other thread is allowed to be accessing it). - For tiles in the
ContentLoadingstate:- Move the tile to the "Destroying" state.
- Cancel requests if possible (e.g. call CancelRequest on the Unreal Engine request object).
- Wait for the tile to transition out of the
Destroyingstate, indicating thatContentLoadinghas completed or been canceled successfully. It should be ok to block the Unreal Engine game thread while waiting on this because the cancelation / status change happens in the HTTP thread. - Unload the tile.