diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-08-24 02:08:25 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-08-24 02:08:33 +0200 |
commit | fff7455deda80bf483422dd7d7c2446e93522f2d (patch) | |
tree | 4d348ca2b4b316b5f6f9e6ea5b98049726fffe93 /src | |
parent | b0875eb3fea0934f3a6651fbc22aac12e33e15e5 (diff) |
Make CScript::clear() release its memory
Diffstat (limited to 'src')
-rw-r--r-- | src/script.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script.h b/src/script.h index 7cb863d1c9..1e2cc94efe 100644 --- a/src/script.h +++ b/src/script.h @@ -730,6 +730,12 @@ public: { 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. |