godotengine / godotengine/godot

Embedding Godot in existing Android projects memory leaks

Open
#95,060 2 comments 0 reactions 0 assignees View on GitHub
bug needs testing platform:android
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

version: 4.2.2.stable

Device: Samsung S10 Lite (Android 13)

### System information

Ubuntu 22.04.4 LTS, GODOT ENGINE version: 4.2.2.stable, Device: Samsung S10 Lite (Android 13)

### Issue description

I just tried the official demo GLTF viewer
https://github.com/m4gr3d/Godot-Android-Samples/tree/master/apps/gltf_viewer

When i close the app with back button of device below error came in log and also sometime app crashing

```
**Object::Destroy(0xb4000079e9dc7f00) for engine ignored; 2 total active objects
16:55:00.866 libOpenSLES E Object::Destroy(0xb4000079e9dc7f00) for engine ignored; active object ID 2 at 0xb4000079e9c08e00
16:55:00.866 libOpenSLES E Object::Destroy(0xb4000079e9dc7f00) for engine ignored; active object ID 3 at 0xb4000079e9c4c400
16:55:00.914 godot E USER WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
16:55:00.914 godot E at: cleanup (core/object/object.cpp:2209)
16:55:00.935 libc A FORTIFY: pthread_mutex_trylock called on a destroyed mutex (0xb400007a6573c66c)
16:55:00.936 libc A Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 28395 (AudioTrack), pid 28260 (com.gododemo3)
16:55:01.245 DEBUG A Cmdline: com.gododemo3
16:55:01.245 DEBUG A pid: 28260, tid: 28395, name: AudioTrack >>> com.gododemo3 <<<
16:55:01.245 DEBUG A #04 pc 00000000000c2d7c /data/app/~~RGYPDDw01I0KEmkQOkUWMw==/com.gododemo3-EfB8SEs8A_rvRlWxX7KLPw==/base.apk!libc++_shared.so (std::__ndk1::recursive_mutex::try_lock()+12) (BuildId: 25b13e08a3a359bf0ac835176dfbc89a7b30c1c4)
16:55:01.245 DEBUG A #05 pc 0000000000d6e620 /data/app/~~RGYPDDw01I0KEmkQOkUWMw==/com.gododemo3-EfB8SEs8A_rvRlWxX7KLPw==/base.apk!libgodot_android.so**
```

i also made the Node2D hello world demo both have same issue.

### Steps to reproduce

Load the demo app in android phone and press back button.

### Minimal reproduction project (MRP)

[GodotoDemo3_App.zip](https://github.com/user-attachments/files/16469776/GodotoDemo3_App.zip)
[TestEmbedded_GODOT_PROJECT.zip](https://github.com/user-attachments/files/16469798/TestEmbedded_GODOT_PROJECT.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.