Skip to content

Commit

Permalink
moved check for valid Entry pointer up
Browse files Browse the repository at this point in the history
  • Loading branch information
patroclos committed Sep 3, 2016
1 parent 156f4e7 commit abbd0f0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/painterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,11 @@ void __updateEntries(PAInterface *interface, std::map<uint32_t, std::unique_ptr<
{
mainloop_lockguard lg(interface->getPAMainloop());

for (iter_entry_t it = map.begin(); it != map.end(); it++)
it->second->m_Kill = true;
for (iter_entry_t it = map.begin(); it != map.end();)
if (it->second)
it++->second->m_Kill = true;
else
it = map.erase(it);

pa_operation *infooper = nullptr;
switch (entrytype)
Expand Down Expand Up @@ -223,11 +226,6 @@ void __updateEntries(PAInterface *interface, std::map<uint32_t, std::unique_ptr<
interface->modifyLock();
for (iter_entry_t it = map.begin(); it != map.end();)
{
if (!it->second)
{
it = map.erase(it);
continue;
}
if (it->second->m_Kill)
{
for (std::vector<std::unique_ptr<std::pair<PAInterface *, Entry *>>>::iterator pairit = interface->m_IEPairs.begin(); pairit != interface->m_IEPairs.end();)
Expand Down

0 comments on commit abbd0f0

Please sign in to comment.