refactor(overlays): hand the shell's overlay host the engine, not the viewer

The controls pass the scene engine to the shell, which initializes the
world overlay on it; initWorldOverlay takes only a globe engine (a viewer
or null is refused), so the shell no longer needs a viewer for its
overlay. engineFromViewer only returns the engine registered for a viewer
(the scene engine until teardown) and never builds one, so no engine can
outlive its viewer without a destroy path. Overlay and detection tests
and the allocation worker build a Cesium engine on their mock viewers and
destroy it with them; frame allocation is unchanged.
This commit is contained in:
German Khokhlov committed 2026-10-15 18:53:57 +04:00
1 parent 3e3aa0bd9f
commit 12c9651a67
10 files changed
+145 -105

No files matched your search

+3 -1
View File
@@ -5,7 +5,7 @@ import { initCockpitCloudEffects } from '../cockpitCloudEffects.js';
/** Construct the existing controls and camera presentation. */
export function createApplicationControls({
scene: { viewer, mapStackController, operations },
scene: { viewer, engine, mapStackController, operations },
loaderStatus,
Controls = StyleManager,
services,
@@ -24,6 +24,8 @@ export function createApplicationControls({
...catalogControlServices(catalog),
},
requestServices: operations.requests,
// The page's globe engine: the shell's overlay host runs on it.
engine,
mapStackController,
placeSearch,
});