[node] Allow GC in spite of reference loops through the request method
The following produces a reference cycle:
var map = new mbgl.Map({
request: function () { ... }
});
map has a reference to the request function, which has a reference to
its closure, which has a reference to map.
Storing a the map options in an internal field, rather than a Persistent,
allows V8 to collect the reference cycle when none of its members have
other references.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "node_request.hpp"
|
||||
#include "node_file_source.hpp"
|
||||
#include <mbgl/storage/response.hpp>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
Reference in New Issue
Block a user