Skip to content
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

Unmounting ReactPIXIComponent does not destroy internal Display Object instance #90

Open
michalochman opened this issue Jul 20, 2017 · 1 comment

Comments

@michalochman
Copy link
Contributor

michalochman commented Jul 20, 2017

The unmountComponent method should at least call destroy method with { children: true } as an argument and probably unset internal _displayObject property – there is no need to keep a reference to these after component is unmounted:

var CommonDisplayObjectContainerImplementation = {
    ....
    unmountComponent: function unmountComponent() {
        this.unmountChildren();
+        this._displayObject.destroy({ children: true })
+        this._displayObject = null
    },
    ...
};

Not calling destroy on this._displayObject causes a memory leak.

I suppose we could also reset all properties that are assigned in the mountComponent method.

@michalochman
Copy link
Contributor Author

michalochman commented Jul 31, 2017

@Izzimach do you think you will be able to release the above this week on npm? Same question for #89.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant