google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.44k stars 1.84k forks source link

crash on iOS with destroy _resourceLoader #7672

Closed ShenYj closed 4 months ago

ShenYj commented 4 months ago

⚠️ Issues not using this template will be systematically closed.

Describe the bug the render views are in the root controller in all the demos. e.g. gilt-view, modify the vc to the second page, push to it, and then pop back it will crash every time

- (void)dealloc {
    [self destroyModel];

    delete _manipulator;
    delete _stbDecoder;
    delete _ktxDecoder;

    _materialProvider->destroyMaterials();
    delete _materialProvider;
    auto* ncm = _assetLoader->getNames();
    delete ncm;
    AssetLoader::destroy(&_assetLoader);
    delete _resourceLoader;

    _engine->destroy(_swapChain);
    _engine->destroy(_view);
    EntityManager::get().destroy(_entities.camera);
    _engine->destroyCameraComponent(_entities.camera);
    _engine->destroy(_scene);
    _engine->destroy(_renderer);
    _engine->destroy(&_engine);
}

crashed at -[FILModelView dealloc]. --- delete _resourceLoader;

here is the screenshot:

截屏2024-03-15 13 52 38