Skip to content

There's no way to release Unity resources #281

@Zazo032

Description

@Zazo032

Describe the bug
There's no way to release resources used by UnityWidget. We are using Unity for an AR feature, and the second time you open the screen with a UnityWidget, camera lags a lot and there's no loading screen, meaning previous Unity resources were not released. Moreover, doing it 2/3 times fast enough crashes the app because it runs out of memory.

To Reproduce
In the example app, you can see a similar behavior:

  1. Open rotation sample
  2. "Made with Unity" loading screen is shown
  3. Go back
  4. Open rotation sample again
  5. No "Made with Unity" screen is shown, the controller was not released/disposed properly

Expected behavior
After disposing the controller, it should stop all Unity resources

Actual behavior
Disposing/unloading the controller doesn't help with resources, and calling quit closes the app.

Smartphone (please complete the following information):

  • Device: OnePlus 5
  • OS: Android
  • Version: 10

Additional context
Also tried using openInNativeProcess and adding the extended activity in manifest, but that way we can't communicate with messages to the Unity process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions