Missing network share when loading up previous data source throws thread exception

Bug #414321 reported by Ken McLean
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenScore
Fix Committed
Medium
Craig Mahony

Bug Description

Missing network share when loading up previous data source throws thread exception

1. Load up a remote data source, and close Openscore
2. Disable the network
3. Open Openscore
When trying to load up remote data source, thread exception is thrown. Application also hangs:

15:17:29.546:ERROR:Couldn't trigger menus because display isn't initialised.
15:17:29.656:ERROR:Path to storage is not a directory.
Exception in thread "Thread-0" org.eclipse.swt.SWTException: Invalid thread access
        at org.eclipse.swt.SWT.error(SWT.java:3777)
        at org.eclipse.swt.SWT.error(SWT.java:3695)
        at org.eclipse.swt.SWT.error(SWT.java:3666)
        at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:355)
        at org.eclipse.swt.widgets.Widget.checkParent(Widget.java:275)
        at org.eclipse.swt.widgets.Widget.<init>(Widget.java:146)
        at org.eclipse.swt.widgets.Control.<init>(Control.java:101)
        at org.eclipse.swt.widgets.Scrollable.<init>(Scrollable.java:74)
        at org.eclipse.swt.widgets.Composite.<init>(Composite.java:94)
        at avscoreswt.gui.Background.<init>(Background.java:24)
        at avscoreswt.gui.BaseFrame.resetMainArea(BaseFrame.java:475)
        at avscoreswt.gui.BaseFrame.disconnect(BaseFrame.java:432)
        at avscoreswt.gui.BaseFrame$2.run(BaseFrame.java:236)
15:17:29.984:INFO :Identified platform as Windows XP 5.1 on arch x86
15:17:29.984:INFO :Identified version as Nightly 0.1-20090815

Revision history for this message
Tudor Holton (tudor) wrote :

My understanding of this situation is that we should be using asyncExec to avoid InvalidThreadAccessException s.

Revision history for this message
Craig Mahony (cmahony) wrote :

This type of bug, "Invalid thread Access" occurs when a nonGui thread is attempting to update swt components. It is necessary to put in something like
// to determine if we are using a Gui thread
if(Display.getCurrent() != null){ setCurrentContents(current);
}else{
// if not using a Gui thread then start one and use that
Display.getDefault().asyncExec(new Runnable(){
public void run() {
setCurrentContents(current);
}});
}
Please test though. I put this into the setCurrent() of BaseFrame MainArea but it may need to go elsewhere as well.

Changed in openscore:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.