Skip to main content

Threading and Async Loading

Inventory operations run synchronously on the thread that calls RunOperation. The code does not marshal every mutation to the Game Thread and does not protect entry arrays with locks. Call operations from Unreal's Game Thread; do not mutate inventories from background workers.


Database Loading​

The manager uses FStreamableManager::RequestAsyncLoad for unloaded soft database references, with a UObject-bound completion delegate. Loaded databases are indexed immediately. Callbacks populate the subsystem's item maps; there is no complete public readiness signal or cancellation protocol for an entire database load batch.


Presentation Loading​

LoadSlotDataAssetAsync takes SlotID and a soft asset reference, then broadcasts OnSlotDataAssetLoaded on success. A null/unresolved asset does not deliver a general failure result. Widget classes and descriptions are also loaded asynchronously. Some callbacks use CreateWeakLambda and explicitly enqueue an AsyncTask on the Game Thread.

Weak callbacks and IsValid checks reduce lifetime hazards, but queued lambdas still capture raw this in several paths. This review does not establish that every destruction/reconstruction race is safe. Test widget closing, travel, unload failures and delayed completions; avoid retained entry pointers across asynchronous work.

The slot GUID supplied to the asset callback identifies the presentation request. Confirm that the receiving widget still represents that slot before applying loaded data. For startup gating, see Subsystem Lifecycle.