* Fix crashing bug in event vector cleanup

* Fix warnings in settings.cpp
* Add settings to ui of powertoys
This commit is contained in:
Chris Davis
2019-11-11 20:58:39 -08:00
parent 1e89054897
commit e328c5d505
8 changed files with 476 additions and 418 deletions

View File

@@ -53,16 +53,16 @@ IFACEMETHODIMP CPowerRenameRegEx::UnAdvise(_In_ DWORD cookie)
HRESULT hr = E_FAIL;
CSRWExclusiveAutoLock lock(&m_lockEvents);
for (auto it : m_renameRegExEvents)
for (std::vector<RENAME_REGEX_EVENT>::iterator it = m_renameRegExEvents.begin(); it != m_renameRegExEvents.end(); ++it)
{
if (it.cookie == cookie)
if (it->cookie == cookie)
{
hr = S_OK;
it.cookie = 0;
if (it.pEvents)
it->cookie = 0;
if (it->pEvents)
{
it.pEvents->Release();
it.pEvents = nullptr;
it->pEvents->Release();
it->pEvents = nullptr;
}
break;
}