diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-06-17 00:13:34 +0300 |
---|---|---|
committer | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-06-17 00:40:42 +0300 |
commit | be00174229b0115a88688e639171a98381b20cf8 (patch) | |
tree | 86634eeb9abaa2aa3512cb5f94652ec8a76bdb1d /main/src/addins/Deployment/MonoDevelop.Deployment | |
parent | fc3170531a206bddcf4e6011cccfe4a879fa30fa (diff) |
[Misc] 1/4 batch of checking disposes of dialogs.
Diffstat (limited to 'main/src/addins/Deployment/MonoDevelop.Deployment')
2 files changed, 6 insertions, 5 deletions
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs index 1f877eef1d..0c69abd6fd 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs @@ -57,9 +57,10 @@ namespace MonoDevelop.Deployment.Gui public static void ShowPackageSettings (Package package) { - EditPackageDialog dlg = new EditPackageDialog (package); - if (MessageService.ShowCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) - IdeApp.ProjectOperations.Save (package.ParentProject); + using (EditPackageDialog dlg = new EditPackageDialog (package)) { + if (MessageService.ShowCustomDialog (dlg) == (int)Gtk.ResponseType.Ok) + IdeApp.ProjectOperations.Save (package.ParentProject); + } } } } diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs index 009cb2e770..3d9f2fda4e 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs @@ -59,8 +59,8 @@ namespace MonoDevelop.Deployment.Gui //IFileReplacePolicy is not likely to be running in the GUI thread //so use some DispatchService magic to synchronously call the dialog in the GUI thread DispatchService.GuiSyncDispatch (delegate { - var dialog = new FileReplaceDialog (response, source, sourceModified.ToString (), target, targetModified.ToString ()); - response = (FileReplaceDialog.ReplaceResponse) MessageService.ShowCustomDialog (dialog); + using (var dialog = new FileReplaceDialog (response, source, sourceModified.ToString (), target, targetModified.ToString ())) + response = (FileReplaceDialog.ReplaceResponse) MessageService.ShowCustomDialog (dialog); }); switch (response) { |