| 369 | } |
| 370 | |
| 371 | void ProgressBarStop(int slotIndex) |
| 372 | { |
| 373 | assert( slotIndex >= 0 && slotIndex < g_ProgressSlotCount ); |
| 374 | std::thread threadToJoin; |
| 375 | { |
| 376 | ProgressBarGlobals& slot = g_ProgressSlots[slotIndex]; |
| 377 | std::lock_guard guard(slot.Mutex); |
| 378 | |
| 379 | slot.Active = false; |
| 380 | slot.Title = ""; |
| 381 | slot.Value = 0; |
| 382 | #ifdef _WIN32 |
| 383 | slot.hMainWindow = nullptr; |
| 384 | slot.hProgressBar = nullptr; |
| 385 | #endif |
| 386 | threadToJoin.swap(slot.Thread); |
| 387 | } |
| 388 | if (threadToJoin.joinable()) |
| 389 | threadToJoin.join(); |
| 390 | } |
| 391 | |
| 392 | void ProgressBarUpdate(int slotIndex, int percentage) |
| 393 | { |