Skip to content

Realm 20.1.0 no longer closes Realms when stopping Unity player #3700

@peachypixels

Description

@peachypixels

What happened?

Hello!

I'm noticing different behaviour between 12.5.0 and 20.1.0 with regards to quitting the Unity player and open Realms (see repro steps)

I've no idea if this happens when running on production\device builds. It doesn't appear to be causing any issues in on-device beta testing, but maybe OS sandboxing is 'helping' here with regards to open files \ file handles.

I can see that the closing\cleanup call originates from Initializer.Initialize that then calls NativeCommon.CleanupNativeResources on the Unity Application.quitting callback.

There are some subtle differences between the two versions, but I'm not in a position to look any further into the issue. Sorry.

So just raising it here in-case someone is able to confirm it's not a bug or that they can investigate further.

Repro steps

Running in Unity then stopping the player, the following used to occur with (12.5.0)...

  1. Realm is open
  2. Unity player is stopped (but not closed)
  3. Logging [Realm.SDK Info: Realm: Force closing all native instances: Application is exiting]
  4. Logging [Realm.SDK Info: Realm: Closed all native instances in NN ms]
  5. Realm is closed (tested by attempting to rename file)

But with (20.1.0) the following occurs...

  1. Realm is open
  2. Unity player is stopped (but not closed)
  3. Realm is still open (tested by attempting to rename file)

Version

Unknown

What Atlas Services are you using?

Local Database only

What type of application is this?

Unity

Client OS and version

Windows 10 (22H2)

Code snippets

No response

Stacktrace of the exception/crash you're getting

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions