diff --git a/src/twn_textures.c b/src/twn_textures.c index 6540047..cd08689 100644 --- a/src/twn_textures.c +++ b/src/twn_textures.c @@ -509,13 +509,13 @@ static TextureKey textures_load(TextureCache *cache, const char *path) { /* place a dummy for future lookups to know it will be loaded */ /* as well as a place for worker to fill in */ + SDL_LockMutex(textures_load_mutex); shput(cache->hash, path, (Texture){0}); /* append a new request, use stable indices */ struct TextureLoadRequest const request = { .index = shlenu(cache->hash) - 1, }; - SDL_LockMutex(textures_load_mutex); arrpush(texture_load_queue, request); SDL_UnlockMutex(textures_load_mutex);