-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
leaking event handlers #17
Comments
I can't reproduce it (in Dartium and with dart2js). I have added the following code to https://github.com/a14n/dart-google-maps/blob/master/example/04-overlays/marker-simple/page.dart : marker.onClick.listen((_){
for (int k = 0; k < 10000000; ++k) {
marker.onClick.listen((_) => print('foo')).cancel();
}
window.alert('ok');
}); When I click on the marker several times, the memory moves a little up and down but it doesn't look like a leak. |
Weird, I think we're both right. If the marker isn't attached to the map On Tue, Jan 14, 2014 at 12:37 AM, Alexandre Ardhuin <
|
Canceling event handlers doesn't release the memory. Here's an example:
RAM used by the browser will increase each time the loop runs. It's not so bad in this example, but if the closure has references to other objects, they don't seem to be GC'd either.
If there's a different way I'm supposed to be canceling these, happy to try that.
The text was updated successfully, but these errors were encountered: