Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioStreamPlayer leak at exit #95484

Closed
ndbn opened this issue Aug 13, 2024 · 3 comments
Closed

AudioStreamPlayer leak at exit #95484

ndbn opened this issue Aug 13, 2024 · 3 comments

Comments

@ndbn
Copy link

ndbn commented Aug 13, 2024

Tested versions

4.2, 4.3

System information

Windows 10, x64

Issue description

Posible releated #76745 #67589 #84398 , but a bit different error log

Only seen if whole godot run from console and with --verbose flag
Error log:

`WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object/object.cpp:2209)
Leaked instance: AudioStreamPlaybackMP3:9223372060577760454
Leaked instance: AudioStreamMP3:9223372060309324999 - Resource path: res://Make a Choice.mp3
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with 
`free()` or `queue_free()`).
ERROR: Resources still in use at exit (run with --verbose for details).
   at: clear (core/io/resource.cpp:492)
Resource still in use: res://Make a Choice.mp3 (AudioStreamMP3)
Orphan StringName: _mix (static: 0, total: 1)
Orphan StringName: _stop (static: 0, total: 1)
Orphan StringName: _setup_local_to_scene (static: 0, total: 1)
Orphan StringName: _get_beat_count (static: 0, total: 1)
Orphan StringName: _mix_resampled (static: 0, total: 1)
Orphan StringName: _get_stream_sampling_rate (static: 0, total: 1)
Orphan StringName: _get_playback_position (static: 0, total: 1)
Orphan StringName: _get_stream_name (static: 0, total: 1)
Orphan StringName: _start (static: 0, total: 1)
Orphan StringName: _has_loop (static: 0, total: 1)
Orphan StringName: _is_playing (static: 0, total: 1)
Orphan StringName: _get_bar_beats (static: 0, total: 1)

Steps to reproduce

Call get_tree().quit() when sound plaing
tested with differens stream types.

IMO problem is here
Internal player memory just freed and posible fix can be just add
internal->stream = nullptr;
so RefCounted can do job

Minimal reproduction project (MRP)

audiostream_leaked_mrp.zip

@AThousandShips
Copy link
Member

The clearing of the internal stream is handled automatically when destroying AudioStream, Ref handles reference counting, this is probably cased by something else, some instance being kept around in the server most likely

@ndbn
Copy link
Author

ndbn commented Aug 22, 2024

Also seems AudioStream* resources stored even between scenes

Leak reported even after AudioServer destructor called.

@ndbn
Copy link
Author

ndbn commented Aug 23, 2024

I log(stdout) Resource construction and Ref instances create and destruction, there is no difference between leaked quit and non-leaked quit, all refs unreferenced...

@ndbn ndbn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants