From 99e7e8c9837fd25e4cd7b9f3d33b7c156e8277cf Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 4 Apr 2016 13:54:55 +0200 Subject: [PATCH] Disabled CACHED_CONTAINER freeing memory on GAL<->legacy switch. --- common/gal/opengl/cached_container.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/common/gal/opengl/cached_container.cpp b/common/gal/opengl/cached_container.cpp index f2e801e952..4e428622a1 100644 --- a/common/gal/opengl/cached_container.cpp +++ b/common/gal/opengl/cached_container.cpp @@ -1,7 +1,7 @@ /* * 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 * * 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() { - // Change size to the default one - m_vertices = static_cast( realloc( m_vertices, - m_initialSize * sizeof( VERTEX ) ) ); - - // Reset state variables - m_freeSpace = m_initialSize; - m_currentSize = m_initialSize; + m_freeSpace = m_currentSize; m_failed = false; // Set the size of all the stored VERTEX_ITEMs to 0, so it is clear that they are not held // in the container anymore - ITEMS::iterator it; - - for( it = m_items.begin(); it != m_items.end(); ++it ) + for( ITEMS::iterator it = m_items.begin(); it != m_items.end(); ++it ) { ( *it )->setSize( 0 ); }