Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class Toolbar extends React.Component {
}
}
}
componentWillUnmount() {
this.boundShortcuts.forEach(shortcut => Mousetrap.unbind(shortcut));
}
renderToolbarItem = (item) => {
const active = this.props.currentTask === (item.task || item.key) && this.props.currentTaskMode === (item.mode || null);
const title = LocaleUtils.tr("appmenu.items." + item.key + (item.mode || ""));
Expand Down
2 changes: 2 additions & 0 deletions components/map/OlMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ class OlMap extends React.Component {
}
componentWillUnmount() {
this.map.un('change:size', this.recreateKeyboardInteractions);
clearTimeout(this.unpauseTimeout);
this.map.setTarget(null);
}
recreateKeyboardInteractions = () => {
this.keyboardPanInteractions.forEach(interaction => {
Expand Down
4 changes: 4 additions & 0 deletions plugins/API.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ class API extends React.Component {
window.parent.postMessage("QWC2ApiReady", "*");
}
}
componentWillUnmount() {
window.removeEventListener("message", this.handleMessage);
delete window.qwc2;
}
static propTypes = {
addLayer: PropTypes.func,
/* List of origins which are allowed to post messages via `qwcIframe.postMessage`. */
Expand Down
6 changes: 6 additions & 0 deletions plugins/Authentication.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class Authentication extends React.Component {
window.addEventListener('wheel', this.resetIdleTimer, {passive: true});
}
}
componentWillUnmount() {
clearTimeout(this.idleTimer);
window.removeEventListener('keydown', this.resetIdleTimer, {passive: true});
window.removeEventListener('mousedown', this.resetIdleTimer, {passive: true});
window.removeEventListener('wheel', this.resetIdleTimer, {passive: true});
}
componentDidUpdate(prevProps) {
const task = this.props.task;
if (task !== prevProps.task) {
Expand Down
Loading