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:
authorAlan McGovern <alan@xamarin.com>2013-08-22 00:38:17 +0400
committerAlan McGovern <alan@xamarin.com>2013-08-22 00:38:17 +0400
commit6ac5b1c5e34c7a9346c120969ca846d949bfab3b (patch)
treebe61d2d3050dc46a11151265354091c59d35b484 /main/src/tools
parent55997cdc66cb5310df036de7686d95481c2217b5 (diff)
[Core] Get rid of some of our asynchronous initialisation when running mdtool
We *cannot* have things asynchronously initializing in the case where we are invoking mdtool setup reg-build. This causes all kinds of errors as our code assumes that once we initialize MD, the addin registry is safe to use. If we execute reg-build we actually delete the entire addin database cache from the disk and so we can trigger issues like multiple threads trying to rebuild the database simultaenously, or weird exceptions because the main code is trying to access information from addins like Addin.Description, which is loaded from the files on disk which have been deleted as we are rebuilding the database.
Diffstat (limited to 'main/src/tools')
-rw-r--r--main/src/tools/mdtool/src/mdtool.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/src/tools/mdtool/src/mdtool.cs b/main/src/tools/mdtool/src/mdtool.cs
index fece250a66..0ce1031224 100644
--- a/main/src/tools/mdtool/src/mdtool.cs
+++ b/main/src/tools/mdtool/src/mdtool.cs
@@ -40,7 +40,10 @@ public class MonoDevelopProcessHost
public static int Main (string[] args)
{
try {
- Runtime.Initialize (false);
+ // If we are running mdtool setup reg-build we *must* ensure we do all our initialization synchronously. Otherwise we can end up
+ // in a situation where some addins are trying to use Mono.Addins while we are rebuilding the registry. As you can imagine, this
+ // causes all kinds of strange and unusual crashes and errors.
+ Runtime.Initialize (true, true);
Runtime.SetProcessName ("mdtool");
if (args.Length == 0 || args [0] == "--help") {