Skip to content

Commit f426745

Browse files
authored
fix: await the cell dispose (#1437)
1 parent 840095d commit f426745

16 files changed

+18
-18
lines changed

frontend/app_flowy/lib/plugins/board/application/card/board_checkbox_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class BoardCheckboxCellBloc
3535
cellController.removeListener(_onCellChangedFn!);
3636
_onCellChangedFn = null;
3737
}
38-
cellController.dispose();
38+
await cellController.dispose();
3939
return super.close();
4040
}
4141

frontend/app_flowy/lib/plugins/board/application/card/board_date_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BoardDateCellBloc extends Bloc<BoardDateCellEvent, BoardDateCellState> {
3131
cellController.removeListener(_onCellChangedFn!);
3232
_onCellChangedFn = null;
3333
}
34-
cellController.dispose();
34+
await cellController.dispose();
3535
return super.close();
3636
}
3737

frontend/app_flowy/lib/plugins/board/application/card/board_number_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BoardNumberCellBloc
3232
cellController.removeListener(_onCellChangedFn!);
3333
_onCellChangedFn = null;
3434
}
35-
cellController.dispose();
35+
await cellController.dispose();
3636
return super.close();
3737
}
3838

frontend/app_flowy/lib/plugins/board/application/card/board_select_option_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BoardSelectOptionCellBloc
3434
cellController.removeListener(_onCellChangedFn!);
3535
_onCellChangedFn = null;
3636
}
37-
cellController.dispose();
37+
await cellController.dispose();
3838
return super.close();
3939
}
4040

frontend/app_flowy/lib/plugins/board/application/card/board_text_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BoardTextCellBloc extends Bloc<BoardTextCellEvent, BoardTextCellState> {
4141
cellController.removeListener(_onCellChangedFn!);
4242
_onCellChangedFn = null;
4343
}
44-
cellController.dispose();
44+
await cellController.dispose();
4545
return super.close();
4646
}
4747

frontend/app_flowy/lib/plugins/board/application/card/board_url_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class BoardURLCellBloc extends Bloc<BoardURLCellEvent, BoardURLCellState> {
3838
cellController.removeListener(_onCellChangedFn!);
3939
_onCellChangedFn = null;
4040
}
41-
cellController.dispose();
41+
await cellController.dispose();
4242
return super.close();
4343
}
4444

frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_controller.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,20 @@ class IGridCellController<T, D> extends Equatable {
290290
});
291291
}
292292

293-
void dispose() {
293+
Future<void> dispose() async {
294294
if (_isDispose) {
295295
Log.error("$this should only dispose once");
296296
return;
297297
}
298298
_isDispose = true;
299-
_cellListener?.stop();
299+
await _cellListener?.stop();
300300
_loadDataOperation?.cancel();
301301
_saveDataOperation?.cancel();
302302
_cellDataNotifier = null;
303303

304304
if (_onFieldChangedFn != null) {
305305
_fieldNotifier.unregister(_cacheKey, _onFieldChangedFn!);
306-
_fieldNotifier.dispose();
306+
await _fieldNotifier.dispose();
307307
_onFieldChangedFn = null;
308308
}
309309
}

frontend/app_flowy/lib/plugins/grid/application/cell/checkbox_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CheckboxCellBloc extends Bloc<CheckboxCellEvent, CheckboxCellState> {
3737
_onCellChangedFn = null;
3838
}
3939

40-
cellController.dispose();
40+
await cellController.dispose();
4141
return super.close();
4242
}
4343

frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class DateCalBloc extends Bloc<DateCalEvent, DateCalState> {
139139
cellController.removeListener(_onCellChangedFn!);
140140
_onCellChangedFn = null;
141141
}
142-
cellController.dispose();
142+
await cellController.dispose();
143143
return super.close();
144144
}
145145

frontend/app_flowy/lib/plugins/grid/application/cell/date_cell_bloc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class DateCellBloc extends Bloc<DateCellEvent, DateCellState> {
3131
cellController.removeListener(_onCellChangedFn!);
3232
_onCellChangedFn = null;
3333
}
34-
cellController.dispose();
34+
await cellController.dispose();
3535
return super.close();
3636
}
3737

0 commit comments

Comments
 (0)