| 251 | } |
| 252 | |
| 253 | void ContentStorageSystem::Job(int32 index) |
| 254 | { |
| 255 | PROFILE_CPU_NAMED("ContentStorage.Job"); |
| 256 | |
| 257 | const double time = Platform::GetTimeSeconds(); |
| 258 | ScopeLock lock(Locker); |
| 259 | for (auto i = StorageMap.Begin(); i.IsNotEnd(); ++i) |
| 260 | { |
| 261 | auto storage = i->Value; |
| 262 | if (storage->ShouldDispose()) |
| 263 | { |
| 264 | // Remove from collections |
| 265 | if (storage->IsPackage()) |
| 266 | Packages.Remove((FlaxPackage*)storage); |
| 267 | else |
| 268 | Files.Remove((FlaxFile*)storage); |
| 269 | StorageMap.Remove(i); |
| 270 | |
| 271 | // Delete |
| 272 | storage->Dispose(); |
| 273 | Delete(storage); |
| 274 | } |
| 275 | else |
| 276 | { |
| 277 | storage->Tick(time); |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | void ContentStorageSystem::Execute(TaskGraph* graph) |
| 283 | { |