aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2018-09-14 11:05:23 +0200
committerMiguel Costa <miguel.costa@qt.io>2018-09-17 08:26:03 +0000
commit326a2da463b6841db2a43a21f24173ffa7a42cb0 (patch)
tree49523726c249e52269fbf456e10c9b1e38e6c46c
parent71bb6c1bf78a8193b01f91c7476486f03df1de5c (diff)
Disable fast initialization by defaultv2.2.22.2
Will now only run the package initialization in a background thread if there is an environment variable %QTVS_INIT% set with value "fast". Otherwise, initialization runs in the main thread, as before. This is due to reports that initialization is unstable in version 2.2.2 and may cause the extension not to start-up properly or at all. Task-number: QTVSADDINBUG-571 Change-Id: I9ec76ac2fa41c1c2d60375f8462bb057269dbd99 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/qtvstools/Vsix.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qtvstools/Vsix.cs b/src/qtvstools/Vsix.cs
index 9967696a..afe9d482 100644
--- a/src/qtvstools/Vsix.cs
+++ b/src/qtvstools/Vsix.cs
@@ -116,7 +116,7 @@ namespace QtVsTools
{
base.Initialize();
- System.Threading.Tasks.Task.Run(() =>
+ Action init = () =>
{
try {
instance = this;
@@ -194,7 +194,13 @@ namespace QtVsTools
initDone.Set();
}
- });
+ };
+
+ var QtVs_Init = Environment.GetEnvironmentVariable("QtVs_Init");
+ if (string.Equals(QtVs_Init, "fast", StringComparison.InvariantCultureIgnoreCase))
+ System.Threading.Tasks.Task.Run(init);
+ else
+ init();
}
/// <summary>