Skip to content

Commit

Permalink
Fix old baked image not being disposed
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed May 19, 2024
1 parent a7d4874 commit 85b507a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/lib/cubits/current_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
@override
void onChange(Change<CurrentIndex> change) {
super.onChange(change);
if (change.currentState.cameraViewport.image !=
change.nextState.cameraViewport.image) {
change.currentState.cameraViewport.image?.dispose();
}
if (change.nextState.foregrounds != change.currentState.foregrounds ||
change.nextState.temporaryForegrounds !=
change.currentState.temporaryForegrounds ||
Expand Down Expand Up @@ -570,7 +574,6 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
bakedElements: renderers,
unbakedElements: currentRenderers,
visibleElements: visibleElements)));
cameraViewport.image?.dispose();
}

Future<ByteData?> render(NoteData document, DocumentPage page,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/views/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class _EditToolbarState extends State<EditToolbar> {
padding: const EdgeInsets.only(right: 4),
child: AspectRatio(
aspectRatio: 1,
child: FloatingActionButton.small(
child: FloatingActionButton(
tooltip: AppLocalizations.of(context).add,
heroTag: null,
onPressed: () {
Expand Down
2 changes: 2 additions & 0 deletions metadata/en-US/changelogs/106.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
* Center grid items in home page
* Improve webdav requests ([#703](https://github.com/LinwoodDev/Butterfly/pull/703))
* Improve image quality ([#704](https://github.com/LinwoodDev/Butterfly/issues/704))
* Improve baked image quality
* Improve responsiveness
* Fix launching url does nothing
* Fix settings on mobile fill full height
* Fix grid switch on file view will be shown in navigator
* Fix missing scrollbar in home page
* Fix scale proportional not working
* Fix bfly file import and export on android ([#709](https://github.com/LinwoodDev/Butterfly/issues/709))
* Fix old baked image not being disposed
* Upgrade to flutter 3.22

Read more here: https://linwood.dev/butterfly/2.1.1-rc.1

0 comments on commit 85b507a

Please sign in to comment.