changed: OutStreams<>::streams_map should not have null pointers to StreamType objects
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1018 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1328,27 +1328,26 @@ void Generator<StreamType>::CopyTmpStreamToOutputStreams(Item::Function & fun, S
|
||||
for(size_t s=0 ; s < fun.parameters.size() ; ++s)
|
||||
{
|
||||
std::wstring & name = fun.parameters[s]->name;
|
||||
std::pair<typename OutStreams<StreamType>::StreamsMap::iterator, bool> iterator_inserted = output_stream_map->streams_map.insert(std::make_pair(name, (StreamType*)0));
|
||||
auto imap = output_stream_map->streams_map.find(name);
|
||||
|
||||
StreamType * & stream = iterator_inserted.first->second;
|
||||
bool inserted = iterator_inserted.second;
|
||||
|
||||
if( inserted )
|
||||
if( imap == output_stream_map->streams_map.end() )
|
||||
{
|
||||
if( output_stream_map->streams_map.size() <= output_stream_map->streams_tab.size() )
|
||||
if( output_stream_map->streams_map.size() < output_stream_map->streams_tab.size() )
|
||||
{
|
||||
/* a new stream from the pool (output_stream_tab) has been taken */
|
||||
stream = output_stream_map->streams_tab[ output_stream_map->streams_map.size() - 1 ];
|
||||
/* a new stream from the pool (output_stream_tab) is taken */
|
||||
StreamType * stream = output_stream_map->streams_tab[ output_stream_map->streams_map.size() ];
|
||||
output_stream_map->streams_map.insert(std::make_pair(name, stream));
|
||||
ClearStream(*stream);
|
||||
stream->write(str.c_str(), str.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateMsg(previous_stream, L"limit of output streams has been reached");
|
||||
CreateMsg(previous_stream, L"limit of output streams in OutStreams<> has been reached");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StreamType * stream = imap->second;
|
||||
stream->write(str.c_str(), str.size());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user