corewall / corelyzer

The Corelyzer Core Visualization Tool
http://corewall.org
13 stars 6 forks source link

macOS: Session tracks aren't loaded when Corelyzer is launched through CML session file #18

Open sorghumking opened 3 years ago

sorghumking commented 3 years ago

When a CML session file is used to invoke Corelyzer (via double-click, right-click + Open, or dragging CML file onto Corelyzer app), the session loads incompletely. Data files are added correctly, but tracks and sections don't appear.

CorelyzerAppController.doAssociatedFile() calls loadStateFile(). This eventually leads to CorelyzerAppController.createTrack(), where the SceneGraph.addTrack() call returns -1 instead of a valid, non-negative ID.

However, if I create a Runnable with Thread.sleep(2000) before calling loadStateFile(), everything works correctly.

So it appears the problem is a race condition: we try to add a track before SceneGraph is ready.

To fix, ensure app initialization is complete, then load the CML file.

sorghumking commented 3 years ago

Included the crude "sleep 2000ms" workaround in 2.1.2.