fix: initialize images in a UI job if workbench is running#1011
Open
trancexpress wants to merge 1 commit into
Open
fix: initialize images in a UI job if workbench is running#1011trancexpress wants to merge 1 commit into
trancexpress wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates TMUIPlugin.start() to avoid SWTError: Invalid thread access by deferring image-registry initialization to the UI thread when the Eclipse workbench is running (addressing issue #1010 seen in headless/LSP test scenarios).
Changes:
- Replace direct image initialization in
TMUIPlugin.start()with a dedicatedinitializeImages()helper. - Schedule
TMImagesinitialization via an EclipseUIJobwhenPlatformUI.isWorkbenchRunning()is true.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sebthom
reviewed
Jun 12, 2026
Member
|
@akurtakov do you think a more idomatic solution would be to not initialize the image registry in the start method or async via UIJob but lazy like this? @Override
protected void initializeImageRegistry(final ImageRegistry registry) {
TMImages.initalize(registry);
} |
This change adjusts TMUIPlugin.start() to trigger a UI job for image initalization, to avoid start-up exceptions when TMUIPlugin.start() is not called from a UI thread. Fixes: eclipse-tm4e#1010
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adjusts
TMUIPlugin.start()to trigger a UI job for image initalization, to avoid start-up exceptions whenTMUIPlugin.start()is not called from a UI thread.Fixes: #1010