fixed: in cache.cpp there was headerfile_ezc_cache macro used
(copied from cache.h) fixed: in Generator: memory leak from block_stack objects pointing by block_stack_tab[].out_stream were not deleted fixed: in Item: ClearCache() didn't clear all pointers Function::parameters table were not used git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@979 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
03fe124ad9
commit
6bd8889456
|
@ -35,10 +35,6 @@
|
||||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef headerfile_ezc_cache
|
|
||||||
#define headerfile_ezc_cache
|
|
||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "blocks.h"
|
#include "blocks.h"
|
||||||
|
|
||||||
|
@ -86,5 +82,3 @@ void Cache(Blocks & blocks, Item & item)
|
||||||
} // namespace Ezc
|
} // namespace Ezc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -239,6 +239,8 @@ private:
|
||||||
|
|
||||||
void ClearFilterTab();
|
void ClearFilterTab();
|
||||||
void ClearForStack();
|
void ClearForStack();
|
||||||
|
void ClearBlockStack();
|
||||||
|
|
||||||
void ClearStream(StreamType & str);
|
void ClearStream(StreamType & str);
|
||||||
void RemoveStackFunData(Stack & sitem);
|
void RemoveStackFunData(Stack & sitem);
|
||||||
|
|
||||||
|
@ -416,6 +418,7 @@ Generator<StreamType>::~Generator()
|
||||||
{
|
{
|
||||||
ClearFilterTab();
|
ClearFilterTab();
|
||||||
ClearForStack();
|
ClearForStack();
|
||||||
|
ClearBlockStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -564,6 +567,16 @@ void Generator<StreamType>::ClearFilterTab()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StreamType>
|
||||||
|
void Generator<StreamType>::ClearBlockStack()
|
||||||
|
{
|
||||||
|
for(size_t i=0 ; i<block_stack_tab.size() ; ++i)
|
||||||
|
delete block_stack_tab[i].out_stream;
|
||||||
|
|
||||||
|
block_stack_tab.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class StreamType>
|
template<class StreamType>
|
||||||
void Generator<StreamType>::ClearForStack()
|
void Generator<StreamType>::ClearForStack()
|
||||||
{
|
{
|
||||||
|
|
14
src/item.cpp
14
src/item.cpp
|
@ -161,14 +161,20 @@ Item::~Item()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Item::ClearCache(Item::Function & function)
|
||||||
|
{
|
||||||
|
function.fun_cache = 0;
|
||||||
|
function.item_block = 0;
|
||||||
|
|
||||||
|
for(size_t i=0 ; i<function.parameters.size() ; ++i)
|
||||||
|
ClearCache(*function.parameters[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Item::ClearCache()
|
void Item::ClearCache()
|
||||||
{
|
{
|
||||||
for(size_t f = 0; f < functions.size() ; ++f)
|
for(size_t f = 0; f < functions.size() ; ++f)
|
||||||
{
|
ClearCache(functions[f]);
|
||||||
functions[f].fun_cache = 0;
|
|
||||||
functions[f].item_block = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(size_t i = 0; i < item_tab.size() ; ++i)
|
for(size_t i = 0; i < item_tab.size() ; ++i)
|
||||||
item_tab[i]->ClearCache();
|
item_tab[i]->ClearCache();
|
||||||
|
|
|
@ -146,6 +146,11 @@ struct Item
|
||||||
void Clear();
|
void Clear();
|
||||||
void ClearCache();
|
void ClearCache();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void ClearCache(Item::Function & function);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue