Releasing CesiumWidget object

Hello

I’m working on an application where Cesium viewer is destroyed and created again later in some scenarios. When searching for memory issues I have found that CesiumWidget object is still retaining after the viewer is destroyed via viewer.destroy().

It is reproduced in the simple sandcastle example:

Click Go, wait for several seconds, click Stop, make a heap snapshot. There are multiple CesiumWidget objects are retaining. (Checked via Chrome Dev Tools):

Is this a Cesium issue? Otherwise, could you please hint me if there is a way to re-use CesiumWidget after the viewer was destroyed?

Best Regards
Sergei

Hello Sergei,

Thank you for putting together the Sandcastle example. We’ll have to look into this one further to figure out why the CesiumWidget isn’t being released from memory. I’ve opened an issue here to look into this: CesiumWidget no released from memory when destroyed? · Issue #9298 · CesiumGS/cesium · GitHub

Best regards,

Hannah