Commit 533c4910 authored by Mark Olesen's avatar Mark Olesen
Browse files

dictionary: potential leak/odd behaviour - regexps cleared in the wrong place

parent c6cf2e53
......@@ -48,9 +48,6 @@ bool Foam::dictionary::findInWildcards
{
if (wildCardEntries_.size() > 0)
{
//wcLink = wildCardEntries_.begin();
//reLink = wildCardRegexps_.end();
while (wcLink != wildCardEntries_.end())
{
if (!wildCardMatch && wcLink()->keyword() == Keyword)
......@@ -510,10 +507,7 @@ bool Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
wildCardEntries_.insert(entryPtr);
wildCardRegexps_.insert
(
autoPtr<regExp>
(
new regExp(entryPtr->keyword())
)
autoPtr<regExp>(new regExp(entryPtr->keyword()))
);
}
......@@ -776,6 +770,8 @@ void Foam::dictionary::clear()
{
IDLList<entry>::clear();
hashedEntries_.clear();
wildCardEntries_.clear();
wildCardRegexps_.clear();
}
......
......@@ -137,9 +137,6 @@ Foam::Istream& Foam::operator>>(Istream& is, dictionary& dict)
functionEntries::inputModeEntry::clear();
dict.clear();
dict.hashedEntries_.clear();
dict.wildCardEntries_.clear();
dict.wildCardRegexps_.clear();
dict.read(is);
return is;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment