mirror of
https://github.com/greenshot/greenshot
synced 2025-07-15 01:23:47 -07:00
Code fixes, there was an error in the disposing of a DrawableContainer...
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2536 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
7823138adc
commit
7a4ac7e4f9
3 changed files with 16 additions and 9 deletions
|
@ -61,6 +61,7 @@ namespace Greenshot.Drawing {
|
|||
grippers[i] = null;
|
||||
}
|
||||
}
|
||||
grippers = null;
|
||||
}
|
||||
|
||||
FieldAggregator aggProps = parent.FieldAggregator;
|
||||
|
|
|
@ -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 {
|
|||
/// <param name="disposing"></param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
@ -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);
|
||||
|
|
|
@ -183,7 +183,7 @@ namespace GreenshotPlugin.Core {
|
|||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
bool Contains(int x, int y);
|
||||
new bool Contains(int x, int y);
|
||||
|
||||
/// <summary>
|
||||
/// Set the color at the specified location, using offsetting so the original coordinates can be used
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue