Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit dc31649

Browse files
committed
HACK: eagerly load output pad because pad services cannnot be instanciated from background threads.
A proper fix would be to separate the IOutputPad implementation from the UI, so that output categories can be created and written to from background threads without waiting for the output pad UI to be created.
1 parent 3eac4e0 commit dc31649

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ServiceDoozer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public object BuildItem(BuildItemArgs args)
3737
// Use ServiceCreatorCallback to lazily create the service
3838
container.AddService(
3939
interfaceType, delegate {
40+
// This callback runs within the service container's lock
4041
if (serviceLoading)
4142
throw new InvalidOperationException("Found cyclic dependency when initializating " + className);
4243
serviceLoading = true;

src/Main/SharpDevelop/Workbench/WorkbenchStartup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static void InitializeWorkbench(WpfWorkbench workbench, IWorkbenchLayout layout)
4747

4848
UILanguageService.ValidateLanguage();
4949

50+
SD.GetService<IOutputPad>(); // HACK: eagerly load output pad because pad services cannnot be instanciated from background threads
5051
TaskService.Initialize();
5152
Project.CustomToolsService.Initialize();
5253

0 commit comments

Comments
 (0)