minutemailer / react-popup

React popup component
http://minutemailer.github.io/react-popup/
MIT License
208 stars 71 forks source link

EventEmitter memory leak #52

Closed dannav closed 6 years ago

dannav commented 6 years ago

In componentWillUnmount() event listeners that were placed on the store in componentDidMount() were not removed.

    componentDidMount() {
        Store.on(Constants.SHOW, this.bound.onShow);
        Store.on(Constants.CLOSE, this.bound.onClose);
        Store.on(Constants.REFRESH, this.bound.onRefresh);
    }

    componentWillUnmount() {
        // need to remove Store event listeners
        key.deleteScope('react-popup');
        key.filter = defaultKeyFilter;
    }
tbleckert commented 6 years ago

Ah, thanks! Will make sure it's added in the next release

quannt commented 6 years ago

I want to help on this. @tbleckert

tbleckert commented 6 years ago

Merged in master (thanks to @quannt ). Will be published to npm along with the other v1.0.0 stuff asap.