Commit 7770e021 authored by vogelheim's avatar vogelheim Committed by Commit bot

Always dispose backing store.

(With a v8::Vector, the client is responsible for memory management.
 I think there can be a situation where the Vector has a char[1] backing
 store with '\0' in it, in which case the current code would leak.
 If we always Dispose() the backing store this should be avoided.
 Since dispose will delete[] the actual backing store, this should
 also work then the backing store is nullptr.)

R=jochen@chromium.org
BUG=chromium:525885
LOG=N

Review URL: https://codereview.chromium.org/1410543005

Cr-Commit-Position: refs/heads/master@{#31446}
parent 339e0c80
......@@ -166,11 +166,7 @@ class LiteralBuffer {
public:
LiteralBuffer() : is_one_byte_(true), position_(0), backing_store_() { }
~LiteralBuffer() {
if (backing_store_.length() > 0) {
backing_store_.Dispose();
}
}
~LiteralBuffer() { backing_store_.Dispose(); }
INLINE(void AddChar(uint32_t code_unit)) {
if (position_ >= backing_store_.length()) ExpandBuffer();
......
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