diff options
author | Franziska Hinkelmann <franziska.hinkelmann@gmail.com> | 2017-11-16 15:56:20 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-11-19 16:13:37 +0100 |
commit | 2d50b5e537dd94f238a499083cd234ceca3fff5f (patch) | |
tree | b216a72bb478f9ff46d95c2d6d735e234c3db16a /src/env-inl.h | |
parent | d61cd9d4fe4c434d689ae0553df24d538993f06b (diff) | |
download | android-node-v8-2d50b5e537dd94f238a499083cd234ceca3fff5f.tar.gz android-node-v8-2d50b5e537dd94f238a499083cd234ceca3fff5f.tar.bz2 android-node-v8-2d50b5e537dd94f238a499083cd234ceca3fff5f.zip |
src: use unique_ptr for http2_state
PR-URL: https://github.com/nodejs/node/pull/17078
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r-- | src/env-inl.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/env-inl.h b/src/env-inl.h index 2c55e8cd94..120d550d4d 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -341,7 +341,6 @@ inline Environment::~Environment() { delete[] heap_statistics_buffer_; delete[] heap_space_statistics_buffer_; delete[] http_parser_buffer_; - delete http2_state_; free(performance_state_); } @@ -496,12 +495,13 @@ inline void Environment::set_http_parser_buffer(char* buffer) { } inline http2::http2_state* Environment::http2_state() const { - return http2_state_; + return http2_state_.get(); } -inline void Environment::set_http2_state(http2::http2_state* buffer) { - CHECK_EQ(http2_state_, nullptr); // Should be set only once. - http2_state_ = buffer; +inline void Environment::set_http2_state( + std::unique_ptr<http2::http2_state> buffer) { + CHECK(!http2_state_); // Should be set only once. + http2_state_ = std::move(buffer); } inline double* Environment::fs_stats_field_array() const { |