mirror of https://github.com/KLayout/klayout.git
Bugfix: net tracer memory corruption issue - missing copy ctor/assignment
This commit is contained in:
parent
f0f3025f9f
commit
e47a0966bd
|
|
@ -148,6 +148,39 @@ NetTracerData::NetTracerData ()
|
||||||
// .. nothing yet ..
|
// .. nothing yet ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NetTracerData::NetTracerData (const NetTracerData &other)
|
||||||
|
: m_next_log_layer (0)
|
||||||
|
{
|
||||||
|
operator= (other);
|
||||||
|
}
|
||||||
|
|
||||||
|
NetTracerData &
|
||||||
|
NetTracerData::operator= (const NetTracerData &other)
|
||||||
|
{
|
||||||
|
if (this != &other) {
|
||||||
|
|
||||||
|
for (std::map <unsigned int, NetTracerLayerExpression *>::const_iterator l = m_log_layers.begin (); l != m_log_layers.end (); ++l) {
|
||||||
|
delete l->second;
|
||||||
|
}
|
||||||
|
m_log_layers.clear ();
|
||||||
|
|
||||||
|
for (std::map <unsigned int, NetTracerLayerExpression *>::const_iterator l = other.m_log_layers.begin (); l != other.m_log_layers.end (); ++l) {
|
||||||
|
m_log_layers.insert (std::make_pair (l->first, new NetTracerLayerExpression (*l->second)));
|
||||||
|
}
|
||||||
|
|
||||||
|
m_next_log_layer = other.m_next_log_layer;
|
||||||
|
m_connections = other.m_connections;
|
||||||
|
m_original_layers = other.m_original_layers;
|
||||||
|
m_connection_graph = other.m_connection_graph;
|
||||||
|
m_log_connection_graph = other.m_log_connection_graph;
|
||||||
|
m_requires_booleans = other.m_requires_booleans;
|
||||||
|
m_symbols = other.m_symbols;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
NetTracerData::~NetTracerData ()
|
NetTracerData::~NetTracerData ()
|
||||||
{
|
{
|
||||||
for (std::map <unsigned int, NetTracerLayerExpression *>::const_iterator l = m_log_layers.begin (); l != m_log_layers.end (); ++l) {
|
for (std::map <unsigned int, NetTracerLayerExpression *>::const_iterator l = m_log_layers.begin (); l != m_log_layers.end (); ++l) {
|
||||||
|
|
|
||||||
|
|
@ -487,6 +487,16 @@ public:
|
||||||
*/
|
*/
|
||||||
~NetTracerData ();
|
~NetTracerData ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Copy constructor
|
||||||
|
*/
|
||||||
|
NetTracerData (const NetTracerData &other);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Assignment
|
||||||
|
*/
|
||||||
|
NetTracerData &operator= (const NetTracerData &other);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register a logical layer
|
* @brief Register a logical layer
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue