diff --git a/Greenshot/Drawing/DrawableContainer.cs b/Greenshot/Drawing/DrawableContainer.cs
index 41d265d99..8e165fc76 100644
--- a/Greenshot/Drawing/DrawableContainer.cs
+++ b/Greenshot/Drawing/DrawableContainer.cs
@@ -61,6 +61,7 @@ namespace Greenshot.Drawing {
grippers[i] = null;
}
}
+ grippers = null;
}
FieldAggregator aggProps = parent.FieldAggregator;
diff --git a/Greenshot/Drawing/ImageContainer.cs b/Greenshot/Drawing/ImageContainer.cs
index fa8077168..c4d25949c 100644
--- a/Greenshot/Drawing/ImageContainer.cs
+++ b/Greenshot/Drawing/ImageContainer.cs
@@ -93,7 +93,7 @@ namespace Greenshot.Drawing {
public Image Image {
set {
// Remove all current bitmaps
- Dispose(true);
+ disposeImages();
image = ImageHelper.Clone(value);
bool shadow = GetFieldValueAsBool(FieldType.SHADOW);
CheckShadow(shadow);
@@ -118,18 +118,24 @@ namespace Greenshot.Drawing {
///
protected override void Dispose(bool disposing) {
if (disposing) {
- if (image != null) {
- image.Dispose();
- }
- if (shadowBitmap != null) {
- shadowBitmap.Dispose();
- }
+ disposeImages();
}
image = null;
shadowBitmap = null;
base.Dispose(disposing);
}
+ private void disposeImages() {
+ if (image != null) {
+ image.Dispose();
+ }
+ if (shadowBitmap != null) {
+ shadowBitmap.Dispose();
+ }
+ image = null;
+ shadowBitmap = null;
+ }
+
///
///
///
@@ -153,7 +159,7 @@ namespace Greenshot.Drawing {
Image newImage = ImageHelper.RotateFlip((Bitmap)image, rotateFlipType);
if (newImage != null) {
// Remove all current bitmaps, also the shadow (will be recreated)
- Dispose(true);
+ disposeImages();
image = newImage;
}
base.Rotate(rotateFlipType);
diff --git a/GreenshotPlugin/Core/FastBitmap.cs b/GreenshotPlugin/Core/FastBitmap.cs
index 6f9b11931..c62355590 100644
--- a/GreenshotPlugin/Core/FastBitmap.cs
+++ b/GreenshotPlugin/Core/FastBitmap.cs
@@ -183,7 +183,7 @@ namespace GreenshotPlugin.Core {
///
///
///
- bool Contains(int x, int y);
+ new bool Contains(int x, int y);
///
/// Set the color at the specified location, using offsetting so the original coordinates can be used