Skip to content

Commit

Permalink
Work for surveyjs/survey-creator#4484 - memory leaks in survey creato…
Browse files Browse the repository at this point in the history
…r - dispose list model
  • Loading branch information
tsv2013 committed Aug 29, 2023
1 parent 73ba4ef commit 5476b19
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/actions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ export function createDropdownActionModelAdvanced(actionOptions: IAction, listOp
listOptions.onFilterStringChangedCallback
);
listModel.locOwner = locOwner;
const innerPopupModel: PopupModel = new PopupModel("sv-list", { model: listModel }, popupOptions?.verticalPosition, popupOptions?.horizontalPosition, popupOptions?.showPointer, popupOptions?.isModal, popupOptions?.onCancel, popupOptions?.onApply, popupOptions?.onHide, popupOptions?.onShow, popupOptions?.cssClass, popupOptions?.title);
const innerPopupModel: PopupModel = new PopupModel("sv-list", { model: listModel }, popupOptions?.verticalPosition, popupOptions?.horizontalPosition, popupOptions?.showPointer, popupOptions?.isModal, popupOptions?.onCancel, popupOptions?.onApply, popupOptions?.onHide, popupOptions?.onShow, popupOptions?.cssClass, popupOptions?.title, () => {
listModel.dispose();
});
innerPopupModel.displayMode = popupOptions?.displayMode as any;

const newActionOptions = Object.assign({}, actionOptions, {
Expand Down Expand Up @@ -450,10 +452,10 @@ export class Action extends BaseAction implements IAction, ILocalizableOwner {
this.popupModel.dispose();
}
this.action = undefined;
this.visible = undefined;
this.enabled = undefined;
this.iconName = undefined;
this.iconSize = undefined;
if (!!this.locTitleValue) {
this.locTitleValue.onStringChanged.remove(this.locTitleChanged);
this.locTitleChanged = undefined;
}
}
}

Expand Down

0 comments on commit 5476b19

Please sign in to comment.