Permalink
Browse files

added IDisposable to IHive and IScriptHost

  • Loading branch information...
1 parent bbb6f87 commit 32999b97321c33e6a1294b98be5d406a5cdd988b @kmees kmees committed Mar 14, 2013
@@ -111,5 +111,13 @@ IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
+
+ public void Dispose()
+ {
+ foreach (var hive in _hives)
+ {
+ hive.Dispose();
+ }
+ }
}
}
@@ -94,5 +94,10 @@ private string GetPartialPath(string path)
return path.Replace(Root, "").TrimStart('\\');
}
+
+ public void Dispose()
+ {
+ // nothing to do
+ }
}
}
@@ -1,12 +1,13 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.IO;
namespace IronSharePoint
{
/// <summary>
/// Interface for a virtual folder that contains script files
/// </summary>
- public interface IHive
+ public interface IHive : IDisposable
{
/// <summary>
/// Checks if a file exists at the given <paramref name="path"/>.
@@ -11,7 +11,7 @@
namespace IronSharePoint
{
- public class IronScriptHost : ScriptHost
+ public class IronScriptHost : ScriptHost, IDisposable
{
private readonly IronPlatformAdaptationLayer _ironPlatformAdaptationLayer;
private readonly Guid _siteId;
@@ -68,5 +68,13 @@ private IEnumerable<HiveSetup> GetHiveSetups()
}
return setups;
}
+
+ public void Dispose()
+ {
+ if (_hive != null)
+ {
+ _hive.Dispose();
+ }
+ }
}
}

0 comments on commit 32999b9

Please sign in to comment.