24

I'm using the C++ SDK for Google Play Game Services in a native application built on top of SDL2. The native part is a .so file loaded at runtime.

Everything works just fine as long as I use the application in a standard manner. On the other hand, I'm experiencing problems with gpg::GameServices when it comes to working with multi windows.
When the application switches to the multi windows mode, the native part leaves the main function and re-enters it by design. I don't know if the main function is abandoned because of an user that is terminating the application or because of a switch to the multi windows mode, therefore at the end of the function I reset the pointer to the gpg::GameServices object as suggested in the documentation. It is then re-initialized at the beginning of the same function.

However, it looks like something goes wrong and the application just freezes doing this for a while with the following message:

V/GamesNativeSDK: GameServices cleanup took longer than 15 seconds or returned an error. Destroying object while GameServicesImpl may still be active.

After 20 seconds the application starts again as expected but this freeze is quite annoying and I cannot understand what the reason.
As a side note, calling Flush or FlusBlocking doesn't solve the issue for obvious reasons (I did it just to check if it was the case).

Is there any issue terminating a gpg::GameServices even though the application isn't properly closed? I mean, when the activity is destroyed but the .so isn't discarded, instead a new activity is created and the main function invoked again immediately after?

skypjack
  • 49,335
  • 19
  • 95
  • 187
  • Calling `main()` is undefined behavior, I don't really understand what you are trying to do. Can you link to the documentation about this case ? – Synxis May 17 '18 at 12:28

0 Answers0