Skip to content

Comments

[vislib/tilemap] ensure listeners are cleaned up#8439

Merged
spalger merged 1 commit intoelastic:masterfrom
spalger:fix/functional-tests/tilemap-timeout
Sep 23, 2016
Merged

[vislib/tilemap] ensure listeners are cleaned up#8439
spalger merged 1 commit intoelastic:masterfrom
spalger:fix/functional-tests/tilemap-timeout

Conversation

@spalger
Copy link
Contributor

@spalger spalger commented Sep 22, 2016

Fixes a failing functional test.

With the new "rendered" event, the listener added in the handler was not being cleaned up. This changes it to use the handler's binder, which will cleanup the listener when handler.destroy() is called.

With the new "rendered" event, the listener added in the handler was not being cleaned up. This changes it to use the handler's `binder`, which will cleanup the listener when `handler.destroy()` is called.
Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

render() {
const self = this;
const charts = this.charts = [];
const { binder, charts = [] } = this;
Copy link
Contributor

@thomasneirynck thomasneirynck Sep 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, you can trim the code down by removing these temporary references and just access these from the self var. That also has the added advantage that it's clear we're manipulating instance state. you coudl also remove these temporary copies altogether by changing the each-handler to an annonymous function.

@ppisljar
Copy link
Contributor

LGTM

@spalger spalger merged commit 9f5f567 into elastic:master Sep 23, 2016
spalger pushed a commit to spalger/kibana that referenced this pull request Sep 30, 2016
[vislib/tilemap] ensure listeners are cleaned up

With the new "rendered" event, the listener added in the handler was not being cleaned up. This changes it to use the handler's `binder`, which will cleanup the listener when `handler.destroy()` is called.
spalger pushed a commit to spalger/kibana that referenced this pull request Sep 30, 2016
[vislib/tilemap] ensure listeners are cleaned up

With the new "rendered" event, the listener added in the handler was not being cleaned up. This changes it to use the handler's `binder`, which will cleanup the listener when `handler.destroy()` is called.
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
[vislib/tilemap] ensure listeners are cleaned up

With the new "rendered" event, the listener added in the handler was not being cleaned up. This changes it to use the handler's `binder`, which will cleanup the listener when `handler.destroy()` is called.


Former-commit-id: 6409182
@spalger spalger deleted the fix/functional-tests/tilemap-timeout branch October 18, 2019 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants