Skip to content

Commit 5e1e17e

Browse files
authored
Merge pull request LykosAI#956 from ionite34/backport/main/pr-954
[dev to main] backport: Fix crashes (954)
2 parents 183b655 + 0c1e44c commit 5e1e17e

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

Avalonia.Gif/WebpInstance.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,18 @@ public WebpInstance(Stream currentStream)
5454

5555
var pixSize = new PixelSize(_codec.Info.Width, _codec.Info.Height);
5656

57-
_targetBitmap = new WriteableBitmap(pixSize, new Vector(96, 96), PixelFormat.Bgra8888, AlphaFormat.Opaque);
57+
_targetBitmap = new WriteableBitmap(
58+
pixSize,
59+
new Vector(96, 96),
60+
PixelFormat.Bgra8888,
61+
AlphaFormat.Opaque
62+
);
5863
GifPixelSize = pixSize;
5964

6065
_totalTime = TimeSpan.Zero;
6166

6267
_frameTimes = _codec
63-
.FrameInfo
64-
.Select(frame =>
68+
.FrameInfo.Select(frame =>
6569
{
6670
_totalTime = _totalTime.Add(TimeSpan.FromMilliseconds(frame.Duration));
6771
return _totalTime;

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
1414
- Fixed Inference image selector card buttons taking up the whole height of the card
1515
- Fixed Inference mask editor failing to paint to the right-most edge on large images
1616
- Fixed Inference mask editor not showing the entire image in certain circumstances
17+
- Fixed crash when dragging & dropping images in Inference (hopefully)
1718

1819
## v2.13.0
1920
### Added

StabilityMatrix.Avalonia/Models/ImageSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ protected virtual void Dispose(bool disposing)
277277
if (!disposing)
278278
return;
279279

280-
Bitmap?.Dispose();
280+
Bitmap = null;
281281
}
282282

283283
/// <inheritdoc />

StabilityMatrix.Avalonia/ViewModels/Base/InferenceGenerationViewModelBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ await notificationService.ShowAsync(
421421

422422
// Clear progress
423423
OutputProgress.ClearProgress();
424-
ImageGalleryCardViewModel.PreviewImage?.Dispose();
424+
// ImageGalleryCardViewModel.PreviewImage?.Dispose();
425425
ImageGalleryCardViewModel.PreviewImage = null;
426426
ImageGalleryCardViewModel.IsPreviewOverlayEnabled = false;
427427

StabilityMatrix.Avalonia/ViewModels/Inference/ImageGalleryCardViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void SetPreviewImage(byte[] imageBytes)
8888
PreviewImage = bitmap;
8989
IsPreviewOverlayEnabled = true;
9090

91-
currentImage?.Dispose();
91+
// currentImage?.Dispose();
9292
});
9393
}
9494

StabilityMatrix.Avalonia/ViewModels/Inference/SelectImageCardViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,6 @@ private void LoadUserImage(ImageSource image)
295295

296296
ImageSource = image;
297297

298-
current?.Dispose();
298+
// current?.Dispose();
299299
}
300300
}

0 commit comments

Comments
 (0)