Skip to content

Commit

Permalink
Work for #4484 - memory leaks in survey creator
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Aug 29, 2023
1 parent 415d866 commit 6f4082d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export class SurveyElementAdornerBase<T extends SurveyElement = SurveyElement> e
super.dispose();
this.detachElement(this.surveyElement);
this.actionContainer.dispose();
this.creator.sidebar.onPropertyChanged.remove(this.sidebarFlyoutModeChangedFunc);
this.selectedPropPageFunc = undefined;
this.sidebarFlyoutModeChangedFunc = undefined;
}
protected onElementSelectedChanged(isSelected: boolean): void {
if (!isSelected) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,8 @@ export class TabDesignerPlugin implements ICreatorPlugin {
action: () => {
this.selectSurvey();
},
active: <any>new ComputedUpdater<boolean>(() => {
return notShortCircuitAnd(this.creator.sidebar.activeTab === this.propertyGridTab.id, this.isSurveySelected);
}),
pressed: <any>new ComputedUpdater<boolean>(() => {
return notShortCircuitAnd(this.creator.sidebar.activeTab === this.propertyGridTab.id, this.isSurveySelected);
}),
active: this.isSettingsActive,
pressed: this.isSettingsActive,
visible: this.createVisibleUpdater(),
locTitleName: "ed.surveySettings",
locTooltipName: "ed.surveySettingsTooltip",
Expand Down
1 change: 1 addition & 0 deletions packages/survey-creator-react/src/adorners/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class CreatorSurveyPageComponent extends CreatorModelElement<
}
componentWillUnmount() {
super.componentWillUnmount();
this.model.onPageSelectedCallback = undefined;
this.model.dispose();
}
protected canRender(): boolean {
Expand Down

0 comments on commit 6f4082d

Please sign in to comment.