Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
brianferguson committed Sep 20, 2022
1 parent 42f92d2 commit ab72cf3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Library/MeasureNowPlaying.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ MeasureNowPlaying::~MeasureNowPlaying()
if (--m_Parent->measureCount == 0)
{
player->RemoveInstance();
delete m_Parent;

auto iter = std::find(g_ParentMeasures.begin(), g_ParentMeasures.end(), m_Parent);
g_ParentMeasures.erase(iter);

delete m_Parent;
m_Parent = nullptr;

if (g_ParentMeasures.empty())
{
Internet::Finalize();
Expand Down
2 changes: 1 addition & 1 deletion Library/SkinRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void SkinRegistry::Populate(const std::wstring& path, std::vector<std::wstring>&

int SkinRegistry::PopulateRecursive(const std::wstring& path, std::vector<std::wstring>& favorites, std::wstring base, int index, UINT level)
{
WIN32_FIND_DATA fileData = { 0 }; // Data structure describes the file foun;
WIN32_FIND_DATA fileData = { 0 }; // Data structure describes the file found
HANDLE hSearch = nullptr; // Search handle returned by FindFirstFile
std::list<std::wstring> subfolders;

Expand Down
6 changes: 5 additions & 1 deletion Library/TrayIcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ TrayIcon::~TrayIcon()
}
m_Icons.clear();

if (m_Window) DestroyWindow(m_Window);
if (m_Window)
{
DestroyWindow(m_Window);
m_Window = nullptr;
}
}

void TrayIcon::Initialize()
Expand Down
6 changes: 3 additions & 3 deletions Plugins/PluginFolderInfo/FolderInfoPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ PLUGIN_EXPORT void Finalize(void* data)
measure->folder->RemoveInstance();
}

delete measure;
measure = nullptr;

std::vector<MeasureData*>::iterator iter = std::find(g_Measures.begin(), g_Measures.end(), measure);
g_Measures.erase(iter);

delete measure;
measure = nullptr;
}
8 changes: 6 additions & 2 deletions Plugins/PluginPerfMon/PerfData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,15 @@ ULONGLONG GetPerfData(LPCWSTR objectName, LPCWSTR instanceName, LPCWSTR counterN
break; // No need to continue
}

delete pObjInst;
pObjInst = nullptr;
if (pObjInst)
{
delete pObjInst;
pObjInst = nullptr;
}
}

delete pPerfObj;
pPerfObj = nullptr;
}
}

Expand Down

0 comments on commit ab72cf3

Please sign in to comment.