| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 563bed0 commit 64f6462
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -419,14 +419,14 @@ void AsyncWrap::WeakCallback(const v8::WeakCallbackInfo<DestroyParam>& info) { | |||
| 419 | 419 | HandleScope scope(info.GetIsolate()); | |
| 420 | 420 | ||
| 421 | 421 | Environment* env = Environment::GetCurrent(info.GetIsolate()); | |
| 422 | - DestroyParam* p = info.GetParameter(); | ||
| 422 | + std::unique_ptr<DestroyParam> p{info.GetParameter()}; | ||
| 423 | 423 | Local<Object> prop_bag = PersistentToLocal(info.GetIsolate(), p->propBag); | |
| 424 | 424 | ||
| 425 | 425 | Local<Value> val = prop_bag->Get(env->destroyed_string()); | |
| 426 | 426 | if (val->IsFalse()) { | |
| 427 | 427 | AsyncWrap::EmitDestroy(env, p->asyncId); | |
| 428 | 428 | } | |
| 429 | - delete p; | ||
| 429 | + // unique_ptr goes out of scope here and pointer is deleted. | ||
| 430 | 430 | } | |
| 431 | 431 | ||
| 432 | 432 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments