Disabled CACHED_CONTAINER freeing memory on GAL<->legacy switch.
This commit is contained in:
parent
18cb83f5c7
commit
99e7e8c983
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 CERN
|
* Copyright (C) 2013-2016 CERN
|
||||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -189,20 +189,12 @@ void CACHED_CONTAINER::Delete( VERTEX_ITEM* aItem )
|
||||||
|
|
||||||
void CACHED_CONTAINER::Clear()
|
void CACHED_CONTAINER::Clear()
|
||||||
{
|
{
|
||||||
// Change size to the default one
|
m_freeSpace = m_currentSize;
|
||||||
m_vertices = static_cast<VERTEX*>( realloc( m_vertices,
|
|
||||||
m_initialSize * sizeof( VERTEX ) ) );
|
|
||||||
|
|
||||||
// Reset state variables
|
|
||||||
m_freeSpace = m_initialSize;
|
|
||||||
m_currentSize = m_initialSize;
|
|
||||||
m_failed = false;
|
m_failed = false;
|
||||||
|
|
||||||
// Set the size of all the stored VERTEX_ITEMs to 0, so it is clear that they are not held
|
// Set the size of all the stored VERTEX_ITEMs to 0, so it is clear that they are not held
|
||||||
// in the container anymore
|
// in the container anymore
|
||||||
ITEMS::iterator it;
|
for( ITEMS::iterator it = m_items.begin(); it != m_items.end(); ++it )
|
||||||
|
|
||||||
for( it = m_items.begin(); it != m_items.end(); ++it )
|
|
||||||
{
|
{
|
||||||
( *it )->setSize( 0 );
|
( *it )->setSize( 0 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue