diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-01-26 01:58:37 +0300 |
---|---|---|
committer | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-01-26 19:25:14 +0300 |
commit | bfe719850a431ab688e674bcaa4379c04f8f9e3f (patch) | |
tree | d5f153cf85663e583ef24f245ef9ebf320dd3c12 | |
parent | 6ec3c8963b415e8e8557897a14d109d8b40b00c0 (diff) |
[Ide] Disable TemporaryStorageServiceFactory on Mac
It burns all of our file handles.
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs index c8a102fe00..d6c7ba5a6d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs @@ -23,28 +23,20 @@ namespace MonoDevelop.Ide.TypeSystem static MonoDevelopTemporaryStorageServiceFactory () { - if (Core.Platform.IsWindows || IsCompatibleMono()) { - try { - var asm = Assembly.Load ("Microsoft.CodeAnalysis.Workspaces.Desktop"); - if (asm != null) { - var type = asm.GetType ("Microsoft.CodeAnalysis.Host.TemporaryStorageServiceFactory"); - if (type != null) - microsoftFactory = Activator.CreateInstance (type) as IWorkspaceServiceFactory; - } - } catch (Exception e) { - LoggingService.LogWarning ("MonoDevelopTemporaryStorageServiceFactory: Can't load microsoft temporary storage, fallback to default.", e); - } + // On Mac, the mmap TemporaryStorageServiceFactory crashes the IDE by burning all available file handles + if (Core.Platform.IsMac) { + return; } - } - // remove, if mono >= 4.3 is realeased as stable. - static bool IsCompatibleMono () - { try { - var type = typeof (System.IO.MemoryMappedFiles.MemoryMappedViewAccessor); - return type.GetProperty ("PointerOffset", BindingFlags.Instance | BindingFlags.Public) != null; - } catch (Exception) { - return false; + var asm = Assembly.Load ("Microsoft.CodeAnalysis.Workspaces.Desktop"); + if (asm != null) { + var type = asm.GetType ("Microsoft.CodeAnalysis.Host.TemporaryStorageServiceFactory"); + if (type != null) + microsoftFactory = Activator.CreateInstance (type) as IWorkspaceServiceFactory; + } + } catch (Exception e) { + LoggingService.LogWarning ("Can't load TemporaryStorageServiceFactory, falling back to default.", e); } } |