| 402 | } |
| 403 | |
| 404 | NetworkerThread::NetworkerThread() |
| 405 | { |
| 406 | m_ThreadHandle = CreateThread( |
| 407 | NULL, |
| 408 | 0, |
| 409 | Init, |
| 410 | this, |
| 411 | 0, |
| 412 | &m_ThreadID |
| 413 | ); |
| 414 | |
| 415 | if (!m_ThreadHandle) |
| 416 | { |
| 417 | HRESULT hr = GetLastError(); |
| 418 | std::string str = "Could not start NetworkerThread. Discord Messenger will now close.\n\n(" + std::to_string(hr) + ") " + GetStringFromHResult(hr); |
| 419 | LPCTSTR ctstr = ConvertCppStringToTString(str); |
| 420 | MessageBox(g_Hwnd, ctstr, TEXT("Discord Messenger - Fatal Error"), MB_ICONERROR | MB_OK); |
| 421 | free((void*)ctstr); |
| 422 | exit(1); |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | NetworkerThread::~NetworkerThread() |
| 427 | { |
nothing calls this directly
no test coverage detected