Actually delete persistence in destructor of websockets

This commit is contained in:
Alex Hultman 2019-03-12 15:11:39 +01:00
parent 927cbd1681
commit 5608cbe5ea

View File

@ -20,7 +20,7 @@ void uWS_App_ws(const FunctionCallbackInfo<Value> &args) {
UniquePersistent<Function> closePf;
struct PerSocketData {
Persistent<Object> *socketPf;
UniquePersistent<Object> *socketPf;
};
/* Get the behavior object */
@ -60,7 +60,7 @@ void uWS_App_ws(const FunctionCallbackInfo<Value> &args) {
/* Attach a new V8 object with pointer to us, to us */
PerSocketData *perSocketData = (PerSocketData *) ws->getUserData();
perSocketData->socketPf = new Persistent<Object>;
perSocketData->socketPf = new UniquePersistent<Object>;
perSocketData->socketPf->Reset(isolate, wsObject);
Local<Function> openLf = Local<Function>::New(isolate, openPf);