| 292 | } |
| 293 | |
| 294 | void LibraryManager::ShowStartupError(std::wstring const & msg) |
| 295 | { |
| 296 | if (EoCClient == nullptr |
| 297 | || EoCClientHandleError == nullptr |
| 298 | || EoCAlloc == nullptr) { |
| 299 | return; |
| 300 | } |
| 301 | |
| 302 | std::thread messageThread([this, msg]() { |
| 303 | unsigned retries{ 0 }; |
| 304 | while (!CanShowError() && retries < 600) { |
| 305 | Sleep(100); |
| 306 | retries++; |
| 307 | } |
| 308 | |
| 309 | if (retries >= 300) { |
| 310 | return; |
| 311 | } |
| 312 | |
| 313 | STDWString str; |
| 314 | str.Set(msg); |
| 315 | EoCClientHandleError(*EoCClient, &str, false, &str); |
| 316 | }); |
| 317 | messageThread.detach(); |
| 318 | } |
| 319 | |
| 320 | bool LibraryManager::CanShowError() |
| 321 | { |
no test coverage detected