Слияние кода завершено, страница обновится автоматически
PollingThread::Init после освобождения RaptorEngine, PollingThread::thds_ пул потоков не освобождается, что приводит к утечке памяти
raptor_error PollingThread::Init(int rs_threads, int kernel_threads) {
if (!shutdown_) return RAPTOR_ERROR_FROM_STATIC_STRING("PollingThread has been initialized");
auto e = iocp_.create(static_cast<DWORD>(kernel_threads));
if (e != RAPTOR_ERROR_NONE) {
return e;
}
for (int i = 0; i < rs_threads; i++) {
bool success = false;
> ***********Здесь не освобождено************
Thread *thd = new Thread("iocp:thread",
std::bind(&PollingThread::WorkThread, this, std::placeholders::_1),
nullptr, &success);
> ********************************
if (!success) {
delete thd;
break;
}
thds_.emplace_back(thd);
}
if (thds_.empty()) {
return RAPTOR_ERROR_FROM_STATIC_STRING("PollingThread: Failed to create thread");
}
shutdown_ = false;
return RAPTOR_ERROR_NONE;
}
Вход Перед тем как оставить комментарий