MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / Shutdown

Method Shutdown

modules/engine/runtime/src/resource/resource_system.cpp:276–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276void SResourceSystemImpl::Shutdown()
277{
278 for(auto& pair : resourceRecords)
279 {
280 auto record = pair.second;
281 if (record->loadingStatus == SKR_LOADING_STATUS_ERROR || record->loadingStatus == SKR_LOADING_STATUS_UNLOADED)
282 continue;
283 _UnloadResource(record);
284 }
285 _ClearFinishedRequests();
286 quit = true;
287 Update(); // fill toUpdateRequests once
288 while(!toUpdateRequests.empty())
289 {
290 Update();
291 }
292 for(auto pair : resourceRecords)
293 {
294 auto record = pair.second;
295 SKR_ASSERT(record->loadingStatus == SKR_LOADING_STATUS_ERROR || record->loadingStatus == SKR_LOADING_STATUS_UNLOADED);
296 SkrDelete(record);
297 }
298 resourceRecords.clear();
299
300 resourceRegistry = nullptr;
301}
302
303void SResourceSystemImpl::_ClearFinishedRequests()
304{

Callers 2

DestroyResourceSystemFunction · 0.45
compile_allFunction · 0.45

Calls 3

SkrDeleteFunction · 0.85
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected