mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Cleanup for code-analyses 2nd phase
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2483 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
157cace477
commit
5ffe3dfb42
15 changed files with 190 additions and 137 deletions
|
@ -434,16 +434,6 @@ namespace Greenshot.Drawing {
|
|||
captureDetails = capture.CaptureDetails;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The public accessible Dispose
|
||||
/// Will call the GarbageCollector to SuppressFinalize, preventing being cleaned twice
|
||||
/// </summary>
|
||||
public new void Dispose() {
|
||||
Dispose(true);
|
||||
base.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing) {
|
||||
Count--;
|
||||
|
@ -464,6 +454,17 @@ namespace Greenshot.Drawing {
|
|||
while (redoStack != null && redoStack.Count > 0) {
|
||||
redoStack.Pop().Dispose();
|
||||
}
|
||||
foreach (IDrawableContainer container in elements) {
|
||||
container.Dispose();
|
||||
}
|
||||
if (undrawnElement != null) {
|
||||
undrawnElement.Dispose();
|
||||
undrawnElement = null;
|
||||
}
|
||||
if (cropContainer != null) {
|
||||
cropContainer.Dispose();
|
||||
cropContainer = null;
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
@ -909,7 +910,7 @@ namespace Greenshot.Drawing {
|
|||
ex.Data.Add("Width", Image.Width);
|
||||
ex.Data.Add("Height", Image.Height);
|
||||
ex.Data.Add("Pixelformat", Image.PixelFormat);
|
||||
throw ex;
|
||||
throw;
|
||||
}
|
||||
|
||||
Point offset = new Point(-cropRectangle.Left, -cropRectangle.Top);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue