Skip to content

Commit

Permalink
Make CScript::clear() release its memory
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Aug 24, 2014
1 parent b0875eb commit fff7455
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,12 @@ class CScript : public std::vector<unsigned char>
{
return CScriptID(Hash160(*this));
}

void clear()
{
// The default std::vector::clear() does not release memory.
std::vector<unsigned char>().swap(*this);
}
};

/** Compact serializer for scripts.
Expand Down

0 comments on commit fff7455

Please sign in to comment.