Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

fix: prevent possible memory leak (#1102) #1124

Merged
merged 1 commit into from
Sep 25, 2020
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 @@ -40,6 +40,7 @@
import com.vaadin.flow.component.ComponentEvent;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.ComponentUtil;
import com.vaadin.flow.component.DetachEvent;
import com.vaadin.flow.component.Focusable;
import com.vaadin.flow.component.HasElement;
import com.vaadin.flow.component.HasSize;
Expand Down Expand Up @@ -3011,6 +3012,18 @@ public void sort(List<GridSortOrder<T>> order) {
protected void onAttach(AttachEvent attachEvent) {
super.onAttach(attachEvent);
updateClientSideSorterIndicators(sortOrder);
if (getDataProvider() != null && dataProviderChangeRegistration == null) {
handleDataProviderChange(getDataProvider());
}
}

@Override
protected void onDetach(DetachEvent detachEvent) {
if (dataProviderChangeRegistration != null) {
dataProviderChangeRegistration.remove();
dataProviderChangeRegistration = null;
}
super.onDetach(detachEvent);
}

private void setSortOrder(List<GridSortOrder<T>> order,
Expand Down