1
1
forked from 0ad/0ad
0ad/source/tools/atlas/AtlasUI/General/Observable.cpp
Ykkrosh a1a7dac59c # Integrated Actor Viewer and Actor Editor tools
ObjectManager: Removed ObjectTypes because it hasn't been used for
years.
Atlas: Fixed leak when saving with Xerces. Changed range of water
shininess slider.
Actor Editor: Relabelled "Freq" to "Ratio". Made modal dialogs use the
correct parent.

This was SVN commit r4376.
2006-09-22 17:43:00 +00:00

23 lines
592 B
C++

#include "stdafx.h"
#include "Observable.h"
void ObservableScopedConnections::Add(const ObservableConnection& conn)
{
// Clean up any disconnected connections that might be left in here
m_Conns.erase(
remove_if(m_Conns.begin(), m_Conns.end(),
not1(std::mem_fun_ref(&ObservableConnection::connected))),
m_Conns.end()
);
// Add the new connection
m_Conns.push_back(conn);
}
ObservableScopedConnections::~ObservableScopedConnections()
{
// Disconnect all connections that we hold
for_each(m_Conns.begin(), m_Conns.end(), std::mem_fun_ref(&ObservableConnection::disconnect));
}