Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[node] Don't fire callback when the AsyncRequest was canceled #5162

Merged
merged 1 commit into from
May 26, 2016

Conversation

kkaefer
Copy link
Contributor

@kkaefer kkaefer commented May 26, 2016

When requesting a resource in the node bindings, we're currently returning a plain AsyncRequest object. This means that when we cancel the file request, we're not canceling the associated JS request() call. We can't do that because it's immediate, but that immediate function call is async, so it could fire the passed callback function later on, at a point when the AsyncRequest has long been destroyed.

@kkaefer kkaefer added bug crash Node.js node-mapbox-gl-native labels May 26, 2016
@kkaefer kkaefer self-assigned this May 26, 2016
@kkaefer kkaefer force-pushed the 5162-fix-node-asyncrequest branch from 4809e6e to 27f9a85 Compare May 26, 2016 18:17
@kkaefer
Copy link
Contributor Author

kkaefer commented May 26, 2016

/cc @jfirebaugh @mikemorris

@jfirebaugh
Copy link
Contributor

👍

Thanks for tracking this down.

@kkaefer kkaefer merged commit 27f9a85 into master May 26, 2016
@kkaefer kkaefer deleted the 5162-fix-node-asyncrequest branch May 26, 2016 19:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug crash Node.js node-mapbox-gl-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants