Creating a branch 1.1 where I will try to make the 1.1.7 build available, this means I need to merge some changes from 2.0 to here.

This commit is contained in:
RKrom 2013-12-04 17:46:02 +01:00
parent 2a8e2475d8
commit a03bc31aef
247 changed files with 6986 additions and 8233 deletions

View file

@ -189,8 +189,10 @@ namespace GreenshotPlugin.Core {
break;
case ToolStripDropDownCloseReason.Keyboard:
// Dispose as the close is clicked
surface.Dispose();
surface = null;
if (!captureDetails.HasDestination("Editor")) {
surface.Dispose();
surface = null;
}
break;
default:
eventArgs.Cancel = true;
@ -209,7 +211,6 @@ namespace GreenshotPlugin.Core {
if (clickedDestination == null) {
return;
}
bool isEditor = "Editor".Equals(clickedDestination.Designation);
menu.Tag = clickedDestination.Designation;
// Export
exportInformation = clickedDestination.ExportCapture(true, surface, captureDetails);
@ -218,8 +219,8 @@ namespace GreenshotPlugin.Core {
// close menu if the destination wasn't the editor
menu.Close();
// Cleanup surface, only if the destination wasn't the editor
if (!isEditor) {
// Cleanup surface, only if there is no editor in the destinations and we didn't export to the editor
if (!captureDetails.HasDestination("Editor") && !"Editor".Equals(clickedDestination.Designation)) {
surface.Dispose();
surface = null;
}
@ -245,9 +246,10 @@ namespace GreenshotPlugin.Core {
closeItem.Click += delegate {
// This menu entry is the close itself, we can dispose the surface
menu.Close();
// Dispose as the close is clicked
surface.Dispose();
surface = null;
if (!captureDetails.HasDestination("Editor")) {
surface.Dispose();
surface = null;
}
};
menu.Items.Add(closeItem);