containers minimum elements, windows memory leaks

This commit is contained in:
2022-04-25 21:43:57 +03:00
parent 90afc369f0
commit 5f8c04a78e
7 changed files with 81 additions and 22 deletions

View File

@@ -356,6 +356,7 @@ void PISystemMonitor::run() {
void PISystemMonitor::gatherThread(llong id) {
PISystemMonitor::ThreadStats ts;
if (id == 0) return;
ts.id = id;
#ifdef MICRO_PIP
ts.name = tbid.value(id, "<PIThread>");
@@ -386,11 +387,12 @@ void PISystemMonitor::gatherThread(llong id) {
PISystemTime ct = PISystemTime::current();
FILETIME times[4];
HANDLE thdl = OpenThread(THREAD_QUERY_INFORMATION, FALSE, DWORD(id));
if (thdl == NULL) {
if (!thdl) {
piCout << "[PISystemMonitor] gatherThread(" << id << "):: OpenThread() error:" << errorString();
return;
}
if (GetThreadTimes(thdl, &(times[0]), &(times[1]), &(times[2]), &(times[3])) == 0) {
CloseHandle(thdl);
piCout << "[PISystemMonitor] gatherThread(" << id << "):: GetThreadTimes() error:" << errorString();
return;
}