Pinta latest development on Ubuntu 11.10. The same problem appears on Pinta 1.2-development-preview on Windows XP.
1. Open Pinta.
2. Rectangle Select and mark some area on canvas.
3. "Crop to selection" from toolbar.
4. File | Close
5. Click on "Close without saving" button.
6. File | New - 1024x768 click on OK button.
7. Pinta crashes:
============
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
at System.Collections.Generic.List`1[Pinta.Core.Document].get_Item (Int32 index) [0x00000] in <filename unknown>:0
at Pinta.Core.WorkspaceManager.get_ActiveDocument () [0x00000] in <filename unknown>:0
at Pinta.Tools.SelectTool.OnCommit () [0x00000] in <filename unknown>:0
at Pinta.Core.BaseTool.DoCommit () [0x00000] in <filename unknown>:0
at Pinta.Core.ToolManager.Commit () [0x00000] in <filename unknown>:0
at Pinta.Core.WorkspaceManager.SetActiveDocumentInternal (Pinta.Core.Document document) [0x00000] in <filename unknown>:0
at Pinta.Core.WindowActions+<AddDocument>c__AnonStorey0.<>m__0 (System.Object o, System.EventArgs e) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
============
Fixed in https:/ /github. com/PintaProjec t/Pinta/ commit/ fb71afd011d6e66 10f19f92a4ad233 b47773a5a1