Search Issue Tracker
Fixed
Fixed in 2021.3.40f1, 2022.3.32f1, 6000.0.4f1
Votes
0
Found in
2021.3.34f1
2022.3.20f1
2023.2.9f1
2023.3.0b5
6000.0.0b11
Issue ID
UUM-61733
Regression
No
[Crash] Adding AudioListener component with OnAudioFilterRead crashes the editor
When removing the audio listener on a game object and adding it back, it crashes the editor if the game object has a script with OnAudioFilterRead attached to it.
*Repro*
# Download the attached `OAFR.cs` script.
# Create and open an empty project.
# Import the `OAFR.cs` script.
# In the SampleScene, add the OAFR component to Main Camera.
# Remove the audio listener component.
# Add an audio listener component.
# If the editor does not crash, do the following:
## Remove the OAFR component.
## Repeat steps 4-7
Expected: No error is thrown in the console and the editor does not crash
Actual: An error might be thrown in the console and sometimes the editor crashes.
*Note*
Sometimes the editor doesn't crash but an error is thrown in the console, which might hint at the problem.
*Stack trace (crash)*
See attached `Editor.log`.
*Stack trace (error)*
{code:java}
GameObject has multiple AudioSources and/or AudioListeners attached. While built-in filters like lowpass are instantiated separately, components implementing OnAudioFilterRead may only be used by either one AudioSource or AudioListener at a time.
The reason for this is that any state information used by the callback exists only once in the component, and the source or listener calling it cannot be inferred from the callback.
In this case the OnAudioFilterRead callback of script OAFR was first attached to a component of type AudioListener on the game object after which another component of type AudioListener tried to attach it.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) {code}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UnityYamlMerge.exe doesn't correctly handle merge conflicts in modified properties on a prefab variant
- Inconsistent color scheme in "Details" section of "Select Presets" inspector window
- Crash on __pthread_kill when launching Editor via command-line with "-disableManagedDebugger" argument
- [VFX] Deleting “New Group Node” name doesn’t allow to type or add new name
- [VFX] Creating a long Group Node name breaks nodes boarders
Resolution Note (fix version 6000.0.4f1):
Fixed a bug that would cause the editor to crash if you delete and then re-add an audio listener component.
Resolution Note (fix version 2022.3.32f1):
Fixed a bug that would cause the editor to crash if you delete and then re-add an audio listener component.
Resolution Note (fix version 2021.3.40f1):
Fixed a bug that would cause the editor to crash if you delete and then re-add an audio listener component.