# HG changeset patch # User Benjamin Golinvaux # Date 1606302993 -3600 # Node ID fb62c1522193f908535302b9358626057b95909f # Parent 6594c9709d33b83b1200e301a483b596e726b329 Scene2D must be built first and deleted last! diff -r 6594c9709d33 -r fb62c1522193 OrthancStone/Sources/Scene2DViewport/ViewportController.h --- a/OrthancStone/Sources/Scene2DViewport/ViewportController.h Wed Nov 25 12:16:11 2020 +0100 +++ b/OrthancStone/Sources/Scene2DViewport/ViewportController.h Wed Nov 25 12:16:33 2020 +0100 @@ -233,12 +233,17 @@ private: double GetCanvasToSceneFactor() const; + // The scene can be used by the higher-level objects (including the + // measuring tools), possibly in their destructor, and so it must be + // deleted last (and, thus, constructed first) + std::unique_ptr scene_; + boost::weak_ptr viewport_; + boost::weak_ptr undoStackW_; // Global stack, possibly shared by all viewports std::vector > measureTools_; boost::shared_ptr activeTracker_; // TODO - Couldn't this be a "std::unique_ptr"? - std::unique_ptr scene_; // this is cached double canvasToSceneFactor_;