mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Additional fix to 7849b2a
http://rainmeter.net/forum/viewtopic.php?f=14&t=16014
This commit is contained in:
parent
cd35729a17
commit
ca787306b5
@ -177,6 +177,8 @@ MeterWindow::MeterWindow(const std::wstring& folderPath, const std::wstring& fil
|
|||||||
*/
|
*/
|
||||||
MeterWindow::~MeterWindow()
|
MeterWindow::~MeterWindow()
|
||||||
{
|
{
|
||||||
|
m_State = STATE_CLOSING;
|
||||||
|
|
||||||
if (!m_OnCloseAction.empty())
|
if (!m_OnCloseAction.empty())
|
||||||
{
|
{
|
||||||
GetRainmeter().ExecuteCommand(m_OnCloseAction.c_str(), this);
|
GetRainmeter().ExecuteCommand(m_OnCloseAction.c_str(), this);
|
||||||
@ -383,6 +385,7 @@ void MeterWindow::RemoveWindowExStyle(LONG_PTR flag)
|
|||||||
*/
|
*/
|
||||||
void MeterWindow::Deactivate()
|
void MeterWindow::Deactivate()
|
||||||
{
|
{
|
||||||
|
if (m_State == STATE_CLOSING) return;
|
||||||
m_State = STATE_CLOSING;
|
m_State = STATE_CLOSING;
|
||||||
|
|
||||||
GetRainmeter().RemoveMeterWindow(this);
|
GetRainmeter().RemoveMeterWindow(this);
|
||||||
|
@ -417,6 +417,7 @@ void Rainmeter::Finalize()
|
|||||||
|
|
||||||
DeleteAllUnmanagedMeterWindows();
|
DeleteAllUnmanagedMeterWindows();
|
||||||
DeleteAllMeterWindows();
|
DeleteAllMeterWindows();
|
||||||
|
DeleteAllUnmanagedMeterWindows(); // Redelete unmanaged windows caused by OnCloseAction
|
||||||
|
|
||||||
delete m_TrayWindow;
|
delete m_TrayWindow;
|
||||||
|
|
||||||
@ -981,10 +982,13 @@ void Rainmeter::DeleteAllMeterWindows()
|
|||||||
while (it != m_MeterWindows.cend())
|
while (it != m_MeterWindows.cend())
|
||||||
{
|
{
|
||||||
MeterWindow* mw = (*it).second;
|
MeterWindow* mw = (*it).second;
|
||||||
m_MeterWindows.erase(it++); // Remove before deleting MeterWindow
|
m_MeterWindows.erase(it); // Remove before deleting MeterWindow
|
||||||
|
|
||||||
DialogManage::UpdateSkins(mw, true);
|
DialogManage::UpdateSkins(mw, true);
|
||||||
delete mw;
|
delete mw;
|
||||||
|
|
||||||
|
// Get next valid iterator (Fix for iterator invalidation caused by OnCloseAction)
|
||||||
|
it = m_MeterWindows.cbegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_MeterWindows.clear();
|
m_MeterWindows.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user