(BROKEN) tried to fix, moving on

This commit is contained in:
Ben
2018-12-21 17:25:09 +00:00
parent 2c79ba5a7a
commit 42d5090c3d
4 changed files with 18 additions and 5 deletions

Binary file not shown.

View File

@@ -170,7 +170,10 @@ std::vector<double> CPU::CPU_CORE_PERCENT() {
}
CPU::~CPU() {
std::cout << "CPU Destructed" << std::endl;
if (this->m_isPolling) {
this->m_isPolling = false;
m_pollThread->join();
}
delete m_pollThread;
}

View File

@@ -19,6 +19,7 @@ struct CPUStat {
class CPU {
public:
CPU();
static CPU* Create();
std::mutex CPU_Mutex;
CPUStat* cpuStat;
@@ -50,3 +51,9 @@ private:
};
static CPU* CPU_Instance;
class CPUFactory {
public:
private:
};

View File

@@ -84,7 +84,10 @@ void Memory::END_MEMORY_POLLING() {
}
Memory::~Memory() {
this->m_isPolling = false;
std::cout << "Memory Destructed" << std::endl;
if (this->m_isPolling) {
m_pollThread->join();
this->m_isPolling = false;
}
delete m_pollThread;
}