bare-fs 4.7.2 → 4.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.c +9 -5
- package/package.json +1 -1
- package/prebuilds/android-arm/bare-fs.bare +0 -0
- package/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/prebuilds/android-x64/bare-fs.bare +0 -0
- package/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/prebuilds/win32-x64/bare-fs.bare +0 -0
package/binding.c
CHANGED
|
@@ -74,15 +74,19 @@ bare_fs__request_destroy(bare_fs_req_t *req) {
|
|
|
74
74
|
|
|
75
75
|
static void
|
|
76
76
|
bare_fs__on_request_teardown(js_deferred_teardown_t *handle, void *data) {
|
|
77
|
-
int err;
|
|
78
|
-
|
|
79
77
|
bare_fs_req_t *req = (bare_fs_req_t *) data;
|
|
80
78
|
|
|
81
79
|
req->exiting = true;
|
|
82
80
|
|
|
81
|
+
// If a request is still in flight its result callback is guaranteed to run,
|
|
82
|
+
// even when the underlying work is cancelled successfully, in which case it
|
|
83
|
+
// completes with `UV_ECANCELED`. Destroying the request here would leave that
|
|
84
|
+
// pending callback to operate on freed memory, so we only attempt to cancel
|
|
85
|
+
// the work to hurry it along and defer destruction to the result callback.
|
|
83
86
|
if (req->inflight) {
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
uv_cancel((uv_req_t *) &req->handle);
|
|
88
|
+
|
|
89
|
+
return;
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
bare_fs__request_destroy(req);
|
|
@@ -374,7 +378,7 @@ bare_fs_request_result_string(js_env_t *env, js_callback_info_t *info) {
|
|
|
374
378
|
err = js_create_arraybuffer(env, len, (void *) &data, &result);
|
|
375
379
|
assert(err == 0);
|
|
376
380
|
|
|
377
|
-
|
|
381
|
+
memcpy(data, req->handle.ptr, len);
|
|
378
382
|
|
|
379
383
|
return result;
|
|
380
384
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|