Fix components

This commit is contained in:
Stephan
2019-01-03 21:04:39 +01:00
parent 816ed84a2f
commit 9b756b9ce6

View File

@@ -1,11 +1,12 @@
using System.IO;
using System;
using System.IO;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
namespace Umbraco.Core.Components
{
public class ManifestWatcherComponent : IComponent
public class ManifestWatcherComponent : IComponent, IDisposable
{
// if configured and in debug mode, a ManifestWatcher watches App_Plugins folders for
// package.manifest chances and restarts the application on any change
@@ -25,9 +26,11 @@ namespace Umbraco.Core.Components
_mw.Start(Directory.GetDirectories(appPlugins));
}
public void Terminate()
public void Dispose()
{
_mw?.Dispose();
if (_mw == null) return;
_mw.Dispose();
_mw = null;
}
}