mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fix crash caused by 04090b2
This commit is contained in:
parent
1847e89b8e
commit
9a62ebef95
@ -99,6 +99,7 @@ int RainmeterMain(LPWSTR cmdLine)
|
||||
{
|
||||
ret = rainmeter.MessagePump();
|
||||
}
|
||||
rainmeter.Finalize();
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -143,32 +144,6 @@ Rainmeter::Rainmeter() :
|
||||
*/
|
||||
Rainmeter::~Rainmeter()
|
||||
{
|
||||
KillTimer(m_Window, TIMER_NETSTATS);
|
||||
|
||||
DeleteAllUnmanagedMeterWindows();
|
||||
DeleteAllMeterWindows();
|
||||
|
||||
delete m_TrayWindow;
|
||||
|
||||
System::Finalize();
|
||||
|
||||
MeasureNet::UpdateIFTable();
|
||||
MeasureNet::UpdateStats();
|
||||
WriteStats(true);
|
||||
|
||||
MeasureNet::FinalizeStatic();
|
||||
MeasureCPU::FinalizeStatic();
|
||||
MeterString::FinalizeStatic();
|
||||
|
||||
// Change the work area back
|
||||
if (m_DesktopWorkAreaChanged)
|
||||
{
|
||||
UpdateDesktopWorkArea(true);
|
||||
}
|
||||
|
||||
if (m_ResourceInstance) FreeLibrary(m_ResourceInstance);
|
||||
if (m_Mutex) ReleaseMutex(m_Mutex);
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
GdiplusShutdown(m_GDIplusToken);
|
||||
@ -441,6 +416,35 @@ int Rainmeter::Initialize(LPCWSTR iniPath, LPCWSTR layout)
|
||||
return 0; // All is OK
|
||||
}
|
||||
|
||||
void Rainmeter::Finalize()
|
||||
{
|
||||
KillTimer(m_Window, TIMER_NETSTATS);
|
||||
|
||||
DeleteAllUnmanagedMeterWindows();
|
||||
DeleteAllMeterWindows();
|
||||
|
||||
delete m_TrayWindow;
|
||||
|
||||
System::Finalize();
|
||||
|
||||
MeasureNet::UpdateIFTable();
|
||||
MeasureNet::UpdateStats();
|
||||
WriteStats(true);
|
||||
|
||||
MeasureNet::FinalizeStatic();
|
||||
MeasureCPU::FinalizeStatic();
|
||||
MeterString::FinalizeStatic();
|
||||
|
||||
// Change the work area back
|
||||
if (m_DesktopWorkAreaChanged)
|
||||
{
|
||||
UpdateDesktopWorkArea(true);
|
||||
}
|
||||
|
||||
if (m_ResourceInstance) FreeLibrary(m_ResourceInstance);
|
||||
if (m_Mutex) ReleaseMutex(m_Mutex);
|
||||
}
|
||||
|
||||
bool Rainmeter::IsAlreadyRunning()
|
||||
{
|
||||
typedef struct
|
||||
|
@ -93,6 +93,8 @@ public:
|
||||
static Rainmeter& GetInstance();
|
||||
|
||||
int Initialize(LPCWSTR iniPath, LPCWSTR layout);
|
||||
void Finalize();
|
||||
|
||||
bool IsAlreadyRunning();
|
||||
int MessagePump();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user