| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 67a9742 commit f89f659
22 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -426,8 +426,6 @@ void AsyncWrap::WeakCallback(const v8::WeakCallbackInfo<DestroyParam>& info) { | |||
| 426 | 426 | if (val->IsFalse()) { | |
| 427 | 427 | AsyncWrap::EmitDestroy(env, p->asyncId); | |
| 428 | 428 | } | |
| 429 | - p->target.Reset(); | ||
| 430 | - p->propBag.Reset(); | ||
| 431 | 429 | delete p; | |
| 432 | 430 | } | |
| 433 | 431 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,11 +42,6 @@ inline BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle) | |||
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | - inline BaseObject::~BaseObject() { | ||
| 46 | - CHECK(persistent_handle_.IsEmpty()); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - | ||
| 50 | 45 | inline Persistent<v8::Object>& BaseObject::persistent() { | |
| 51 | 46 | return persistent_handle_; | |
| 52 | 47 | } | |
@@ -65,8 +60,7 @@ inline Environment* BaseObject::env() const { | |||
| 65 | 60 | template <typename Type> | |
| 66 | 61 | inline void BaseObject::WeakCallback( | |
| 67 | 62 | const v8::WeakCallbackInfo<Type>& data) { | |
| 68 | - std::unique_ptr<Type> self(data.GetParameter()); | ||
| 69 | - self->persistent().Reset(); | ||
| 63 | + delete data.GetParameter(); | ||
| 70 | 64 | } | |
| 71 | 65 | ||
| 72 | 66 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ class Environment; | |||
| 34 | 34 | class BaseObject { | |
| 35 | 35 | public: | |
| 36 | 36 | inline BaseObject(Environment* env, v8::Local<v8::Object> handle); | |
| 37 | - inline virtual ~BaseObject(); | ||
| 37 | + virtual ~BaseObject() = default; | ||
| 38 | 38 | ||
| 39 | 39 | // Returns the wrapped object. Returns an empty handle when | |
| 40 | 40 | // persistent.IsEmpty() is true. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -598,7 +598,6 @@ class QueryWrap : public AsyncWrap { | |||
| 598 | 598 | ~QueryWrap() override { | |
| 599 | 599 | CHECK_EQ(false, persistent().IsEmpty()); | |
| 600 | 600 | ClearWrap(object()); | |
| 601 | - persistent().Reset(); | ||
| 602 | 601 | } | |
| 603 | 602 | ||
| 604 | 603 | // Subclasses should implement the appropriate Send method. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -357,9 +357,6 @@ inline Environment::~Environment() { | |||
| 357 | 357 | ||
| 358 | 358 | context()->SetAlignedPointerInEmbedderData(kContextEmbedderDataIndex, | |
| 359 | 359 | nullptr); | |
| 360 | - #define V(PropertyName, TypeName) PropertyName ## _.Reset(); | ||
| 361 | - ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V) | ||
| 362 | - #undef V | ||
| 363 | 360 | ||
| 364 | 361 | delete[] heap_statistics_buffer_; | |
| 365 | 362 | delete[] heap_space_statistics_buffer_; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -300,8 +300,6 @@ void Environment::RunAndClearNativeImmediates() { | |||
| 300 | 300 | v8::TryCatch try_catch(isolate()); | |
| 301 | 301 | for (auto it = list.begin(); it != list.end(); ++it) { | |
| 302 | 302 | it->cb_(this, it->data_); | |
| 303 | - if (it->keep_alive_) | ||
| 304 | - it->keep_alive_->Reset(); | ||
| 305 | 303 | if (it->refed_) | |
| 306 | 304 | ref_count++; | |
| 307 | 305 | if (UNLIKELY(try_catch.HasCaught())) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,11 +98,6 @@ HandleWrap::HandleWrap(Environment* env, | |||
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | - HandleWrap::~HandleWrap() { | ||
| 102 | - CHECK(persistent().IsEmpty()); | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | - | ||
| 106 | 101 | void HandleWrap::OnClose(uv_handle_t* handle) { | |
| 107 | 102 | HandleWrap* wrap = static_cast<HandleWrap*>(handle->data); | |
| 108 | 103 | Environment* env = wrap->env(); | |
@@ -120,7 +115,6 @@ void HandleWrap::OnClose(uv_handle_t* handle) { | |||
| 120 | 115 | wrap->MakeCallback(env->onclose_string(), 0, nullptr); | |
| 121 | 116 | ||
| 122 | 117 | ClearWrap(wrap->object()); | |
| 123 | - wrap->persistent().Reset(); | ||
| 124 | 118 | delete wrap; | |
| 125 | 119 | } | |
| 126 | 120 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,6 @@ class HandleWrap : public AsyncWrap { | |||
| 75 | 75 | v8::Local<v8::Object> object, | |
| 76 | 76 | uv_handle_t* handle, | |
| 77 | 77 | AsyncWrap::ProviderType provider); | |
| 78 | - ~HandleWrap() override; | ||
| 79 | 78 | ||
| 80 | 79 | private: | |
| 81 | 80 | friend class Environment; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,10 +84,6 @@ class JSBindingsConnection : public AsyncWrap { | |||
| 84 | 84 | inspector->Connect(&delegate_); | |
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | - ~JSBindingsConnection() override { | ||
| 88 | - callback_.Reset(); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | 87 | void OnMessage(Local<Value> value) { | |
| 92 | 88 | MakeCallback(callback_.Get(env()->isolate()), 1, &value); | |
| 93 | 89 | } | |
@@ -111,7 +107,6 @@ class JSBindingsConnection : public AsyncWrap { | |||
| 111 | 107 | delegate_.Disconnect(); | |
| 112 | 108 | if (!persistent().IsEmpty()) { | |
| 113 | 109 | ClearWrap(object()); | |
| 114 | - persistent().Reset(); | ||
| 115 | 110 | } | |
| 116 | 111 | delete this; | |
| 117 | 112 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,9 +59,6 @@ ModuleWrap::~ModuleWrap() { | |||
| 59 | 59 | break; | |
| 60 | 60 | } | |
| 61 | 61 | } | |
| 62 | - | ||
| 63 | - module_.Reset(); | ||
| 64 | - context_.Reset(); | ||
| 65 | 62 | } | |
| 66 | 63 | ||
| 67 | 64 | void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) { | |
@@ -215,8 +212,6 @@ void ModuleWrap::Instantiate(const FunctionCallbackInfo<Value>& args) { | |||
| 215 | 212 | module->InstantiateModule(context, ModuleWrap::ResolveCallback); | |
| 216 | 213 | ||
| 217 | 214 | // clear resolve cache on instantiate | |
| 218 | - for (auto& entry : obj->resolve_cache_) | ||
| 219 | - entry.second.Reset(); | ||
| 220 | 215 | obj->resolve_cache_.clear(); | |
| 221 | 216 | ||
| 222 | 217 | if (!ok.FromMaybe(false)) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments