Skip to content

Crashes in UnityPrepareRendererResources when unloading and reloading scenes #561

@azrogers

Description

@azrogers

A user reported on our forums that there were crash issues in Cesium for Unity when unloading and reloading the same scene. I fixed one such issue in #560, but it turns out there's others. I've noticed crashes in UnityPrepareRendererResources::free as well as additional crashes in prepareInLoadThread, particularly while populateMeshDataArray is running in the worker thread.

These crashes seem to come down to the fact that managed resources can be destroyed by Unity while we're in the process of using them on the worker thread. Unfortunately, unlike the GameObject issue which could be solved by a simple null check, I can't think of a way to solve these issues without just giving up on running things in the worker thread entirely. We can't do a null check against a managed array, for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions