diff options
| author | Pieter Wuille <[email protected]> | 2014-08-24 02:08:25 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2014-08-24 02:08:33 +0200 |
| commit | fff7455deda80bf483422dd7d7c2446e93522f2d (patch) | |
| tree | 4d348ca2b4b316b5f6f9e6ea5b98049726fffe93 /src | |
| parent | Allow BatchWrite to destroy its input, reducing copying (diff) | |
| download | discoin-fff7455deda80bf483422dd7d7c2446e93522f2d.tar.xz discoin-fff7455deda80bf483422dd7d7c2446e93522f2d.zip | |
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 7cb863d1c..1e2cc94ef 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. |