| 274 | } |
| 275 | |
| 276 | void 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 | |
| 303 | void SResourceSystemImpl::_ClearFinishedRequests() |
| 304 | { |
no test coverage detected