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

fix: Move construct super to fix memory leak when using multiple withThemeStyles #456

Merged
merged 3 commits into from
Jan 9, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
super._construct();
return;
}
super._construct();

this._hSetByUser = false;
this._wSetByUser = false;
Expand All @@ -107,6 +106,7 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
this.queueThemeUpdate();
});
this._withThemeStylesSetupComplete = true;
super._construct(); // Important that this is called at the bottom to ensure that withThemeStyles is only initialized once per component to prevent potential memory leaks
}

/**
Expand Down
Loading