Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Init UI preferences and invalid thread access

Hey gang,

I have a pretty interesting workspace set up. It unfortunately crashes the IDE once in a while. When it does that the UI preferences end up being re-initialized on startup.

Unfortunate for us, we have some code in the cdt.ui plugin activator, CUIPlugin, that tries to load UI preferences. Not sure why other than it appears to be a workaround for some other issues. And unfortunately, that triggers the preference init. As part of our preference init, we get the current theme which in turn triggers loading the colour registry. And that can only be done on the UI thread.

Now the unfortunate affect of the resulting SWTException is that the theme manager is improperly initialized and that causes the IDE to crash and never be able to start up again on that workspace. That’s pretty bad.

We need to be very disciplined in what we put into the plug-in activators to begin with since they slow down startup. But also you’re running on the thread that triggered you to load which is usually not what you want it to be.

I am currently working on bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=463981 for my instance. Fixing that, I may re break the workarounds that were “fixed”. So please follow that bug to see what I’m breaking and hopefully we can find better workarounds.

Doug.

Back to the top