mirror of https://github.com/Icinga/icinga2.git
Bugfix for deleting delegates.
This commit is contained in:
parent
6b4647a5dc
commit
5c603ee98b
11
base/event.h
11
base/event.h
|
@ -33,16 +33,15 @@ public:
|
|||
|
||||
void operator()(const TArgs& args)
|
||||
{
|
||||
typename vector<DelegateType>::iterator prev, i;
|
||||
typename vector<DelegateType>::iterator i;
|
||||
|
||||
for (i = m_Delegates.begin(); i != m_Delegates.end(); ) {
|
||||
prev = i;
|
||||
i++;
|
||||
|
||||
int result = (*prev)(args);
|
||||
int result = (*i)(args);
|
||||
|
||||
if (result == -1)
|
||||
m_Delegates.erase(prev);
|
||||
i = m_Delegates.erase(i);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClInclude Include="i2-demo.h" />
|
||||
<ClInclude Include="democomponent.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="democomponent.cpp" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jsonrpcclient.cpp" />
|
||||
<ClCompile Include="jsonrpcserver.cpp" />
|
||||
<ClCompile Include="message.cpp" />
|
||||
<ClCompile Include="netstring.cpp" />
|
||||
<ClCompile Include="jsonrpcrequest.cpp" />
|
||||
<ClCompile Include="jsonrpcresponse.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="i2-jsonrpc.h" />
|
||||
<ClInclude Include="jsonrpcclient.h" />
|
||||
<ClInclude Include="jsonrpcserver.h" />
|
||||
<ClInclude Include="message.h" />
|
||||
<ClInclude Include="netstring.h" />
|
||||
<ClInclude Include="jsonrpcrequest.h" />
|
||||
<ClInclude Include="jsonrpcresponse.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in New Issue