Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <teromario@yahoo.com>2015-02-03 21:42:29 +0300
committerMarius Ungureanu <teromario@yahoo.com>2015-02-03 21:42:29 +0300
commitee943316c671ecae5768fb42edff0eb3a527a63a (patch)
tree77de343f86b219c6093fd92a69135a71949679af /main/src/addins/WindowsPlatform
parent29b20b791305aa652229381b49fc77938cdb927b (diff)
parent27816d2d6ab7ba90f744f64129cdf21e4f78af24 (diff)
Merge pull request #692 from mono/memFixes
Trying to not leak some memory.
Diffstat (limited to 'main/src/addins/WindowsPlatform')
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs34
1 files changed, 18 insertions, 16 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
index 00e2dbf048..aaf01a6545 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
@@ -110,15 +110,16 @@ namespace MonoDevelop.Platform
string executeString = exePath + " %1";
string progId = Taskbar.TaskbarManager.Instance.ApplicationId;
- RegistryKey progIdKey = Registry.ClassesRoot.OpenSubKey (progId + @"\shell\Open\Command", false);
- if (progIdKey == null) {
- return false;
- }
+ using (RegistryKey progIdKey = Registry.ClassesRoot.OpenSubKey (progId + @"\shell\Open\Command", false)) {
+ if (progIdKey == null) {
+ return false;
+ }
- object path = progIdKey.GetValue (String.Empty);
- bool isProgIdRegistered = String.Equals (executeString, path as string, StringComparison.OrdinalIgnoreCase);
- if (!isProgIdRegistered) {
- return false;
+ object path = progIdKey.GetValue (String.Empty);
+ bool isProgIdRegistered = String.Equals (executeString, path as string, StringComparison.OrdinalIgnoreCase);
+ if (!isProgIdRegistered) {
+ return false;
+ }
}
string[] subkeyNames = Registry.ClassesRoot.GetSubKeyNames ();
@@ -126,15 +127,16 @@ namespace MonoDevelop.Platform
if (subkey[0] != '.') {
continue;
}
+
+ using (RegistryKey openWithKey = Registry.ClassesRoot.OpenSubKey (Path.Combine (subkey, "OpenWithProgids"))) {
+ if (openWithKey == null) {
+ continue;
+ }
- RegistryKey openWithKey = Registry.ClassesRoot.OpenSubKey (Path.Combine (subkey, "OpenWithProgids"));
- if (openWithKey == null) {
- continue;
- }
-
- string progIdValue = openWithKey.GetValue (progId, null) as string;
- if (progIdValue == null) {
- continue;
+ string progIdValue = openWithKey.GetValue (progId, null) as string;
+ if (progIdValue == null) {
+ continue;
+ }
}
this.supportedExtensions.Add (subkey);