From 5608cbe5ea0f3b15c283fefe29ae575d4cc5286d Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Tue, 12 Mar 2019 15:11:39 +0100 Subject: [PATCH] Actually delete persistence in destructor of websockets --- src/AppWrapper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AppWrapper.h b/src/AppWrapper.h index de6a83d5..9afc87b4 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -20,7 +20,7 @@ void uWS_App_ws(const FunctionCallbackInfo &args) { UniquePersistent closePf; struct PerSocketData { - Persistent *socketPf; + UniquePersistent *socketPf; }; /* Get the behavior object */ @@ -60,7 +60,7 @@ void uWS_App_ws(const FunctionCallbackInfo &args) { /* Attach a new V8 object with pointer to us, to us */ PerSocketData *perSocketData = (PerSocketData *) ws->getUserData(); - perSocketData->socketPf = new Persistent; + perSocketData->socketPf = new UniquePersistent; perSocketData->socketPf->Reset(isolate, wsObject); Local openLf = Local::New(isolate, openPf);