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/MonoDevelop.PackageManagement | |
parent | fc3170531a206bddcf4e6011cccfe4a879fa30fa (diff) |
[Misc] 1/4 batch of checking disposes of dialogs.
Diffstat (limited to 'main/src/addins/MonoDevelop.PackageManagement')
3 files changed, 10 insertions, 8 deletions
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs index e509d351ec..ff92a2f132 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs @@ -40,8 +40,8 @@ namespace MonoDevelop.PackageManagement.Commands try {
var viewModels = new PackageManagementViewModels ();
IPackageManagementEvents packageEvents = PackageManagementServices.PackageManagementEvents;
- var dialog = new ManagePackagesDialog (viewModels.ManagePackagesViewModel, packageEvents);
- MessageService.ShowCustomDialog (dialog);
+ using (var dialog = new ManagePackagesDialog (viewModels.ManagePackagesViewModel, packageEvents))
+ MessageService.ShowCustomDialog (dialog);
} catch (Exception ex) {
LoggingService.LogInternalError (ex);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs index 443d95799c..82c7dcae77 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs @@ -38,9 +38,10 @@ namespace ICSharpCode.PackageManagement {
public bool AcceptLicenses(IEnumerable<IPackage> packages)
{
- LicenseAcceptanceDialog dialog = CreateLicenseAcceptanceDialog(packages);
- int result = MessageService.ShowCustomDialog(dialog);
- return result == (int)Gtk.ResponseType.Ok;
+ using (LicenseAcceptanceDialog dialog = CreateLicenseAcceptanceDialog (packages)) {
+ int result = MessageService.ShowCustomDialog (dialog);
+ return result == (int)Gtk.ResponseType.Ok;
+ }
}
LicenseAcceptanceDialog CreateLicenseAcceptanceDialog(IEnumerable<IPackage> packages)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs index 1972cb8a03..3042569412 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs @@ -37,9 +37,10 @@ namespace ICSharpCode.PackageManagement {
public bool SelectProjects(IEnumerable<IPackageManagementSelectedProject> projects)
{
- SelectProjectsDialog dialog = CreateSelectProjectsDialog(projects);
- int result = MessageService.ShowCustomDialog(dialog);
- return result == (int)Gtk.ResponseType.Ok;
+ using (SelectProjectsDialog dialog = CreateSelectProjectsDialog (projects)) {
+ int result = MessageService.ShowCustomDialog (dialog);
+ return result == (int)Gtk.ResponseType.Ok;
+ }
}
SelectProjectsDialog CreateSelectProjectsDialog(IEnumerable<IPackageManagementSelectedProject> projects)
|