Swap more to UniquePersistent
This commit is contained in:
parent
04c8b5aba5
commit
84bcf4c62f
@ -1,7 +1,6 @@
|
|||||||
// App.post and all other methods - requires good templating?
|
|
||||||
// test so that we pass Autobahn with compression/without compression with SSL/without SSL
|
// test so that we pass Autobahn with compression/without compression with SSL/without SSL
|
||||||
|
|
||||||
/* Helping QtCreator */
|
#include "App.h"
|
||||||
#include <v8.h>
|
#include <v8.h>
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
using namespace v8;
|
using namespace v8;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
using namespace v8;
|
using namespace v8;
|
||||||
|
|
||||||
/* These two are definitely static */
|
/* These two are definitely static */
|
||||||
std::vector<Persistent<Function, CopyablePersistentTraits<Function>>> nextTickQueue;
|
std::vector<UniquePersistent<Function>> nextTickQueue;
|
||||||
Isolate *isolate;
|
Isolate *isolate;
|
||||||
|
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
@ -35,14 +35,14 @@ Isolate *isolate;
|
|||||||
|
|
||||||
/* We are not compatible with Node.js nextTick for performance (and standalone) reasons */
|
/* We are not compatible with Node.js nextTick for performance (and standalone) reasons */
|
||||||
void nextTick(const FunctionCallbackInfo<Value> &args) {
|
void nextTick(const FunctionCallbackInfo<Value> &args) {
|
||||||
nextTickQueue.push_back(Persistent<Function, CopyablePersistentTraits<Function>>(isolate, Local<Function>::Cast(args[0])));
|
nextTickQueue.emplace_back(UniquePersistent<Function>(isolate, Local<Function>::Cast(args[0])));
|
||||||
}
|
}
|
||||||
|
|
||||||
void emptyNextTickQueue(Isolate *isolate) {
|
void emptyNextTickQueue(Isolate *isolate) {
|
||||||
if (nextTickQueue.size()) {
|
if (nextTickQueue.size()) {
|
||||||
HandleScope hs(isolate);
|
HandleScope hs(isolate);
|
||||||
|
|
||||||
for (Persistent<Function, CopyablePersistentTraits<Function>> &f : nextTickQueue) {
|
for (UniquePersistent<Function> &f : nextTickQueue) {
|
||||||
Local<Function>::New(isolate, f)->Call(isolate->GetCurrentContext()->Global(), 0, nullptr);
|
Local<Function>::New(isolate, f)->Call(isolate->GetCurrentContext()->Global(), 0, nullptr);
|
||||||
f.Reset();
|
f.Reset();
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 6718301ac9f0385f3146bab70c9fd7d8fa305562
|
Subproject commit 2a62218d2a4344255463eeb7b1cbda507f90e86f
|
Loading…
Reference in New Issue
Block a user