Skip to content

Commit

Permalink
Merge pull request PintaProject#78 from don-mccomb/SelectToolCheckFor…
Browse files Browse the repository at this point in the history
…Null

Added checks for null in SelectTool mouse-up event

Looks like sensible defensive programming even if you can't prove that it fixes the problem!
  • Loading branch information
robpvn committed Oct 14, 2014
2 parents 76e92d1 + 395632d commit 65da0ca
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Pinta.Tools/Tools/SelectTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,27 @@ protected override void OnMouseUp (DrawingArea canvas, ButtonReleaseEventArgs ar
int tolerance = 0;
if (Math.Abs (reset_origin.X - args.Event.X) <= tolerance && Math.Abs (reset_origin.Y - args.Event.Y) <= tolerance) {
PintaCore.Actions.Edit.Deselect.Activate ();
hist.Dispose ();
hist = null;
handler_active = false;

if (hist != null)
{
hist.Dispose();
hist = null;
}
handler_active = false;
doc.ToolLayer.Clear ();
} else {
ReDraw(args.Event.State);

if (doc.Selection != null)
{
doc.selHandler.PerformSelectionMode(DocumentSelection.ConvertToPolygonSet(doc.Selection.SelectionPolygons));
PintaCore.Workspace.Invalidate();
}

if (hist != null)
doc.History.PushNewItem (hist);

if (hist != null)
{
doc.History.PushNewItem(hist);
hist.Dispose();
hist = null;
}
handler_active = true;
hist.Dispose();
hist = null;
}

is_drawing = false;
Expand Down

0 comments on commit 65da0ca

Please sign in to comment.