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:
authorMikayla Hutchinson <m.j.hutchinson@gmail.com>2017-01-26 01:58:37 +0300
committerMikayla Hutchinson <m.j.hutchinson@gmail.com>2017-01-26 19:25:14 +0300
commitbfe719850a431ab688e674bcaa4379c04f8f9e3f (patch)
treed5f153cf85663e583ef24f245ef9ebf320dd3c12
parent6ec3c8963b415e8e8557897a14d109d8b40b00c0 (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.cs30
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);
}
}