Skip to content

Commit

Permalink
[Audio] Fixed a bug where an audio source would continue to play even…
Browse files Browse the repository at this point in the history
… after it was deleted
  • Loading branch information
PanosK92 committed Oct 23, 2023
1 parent 0e476a8 commit 14a9adb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions runtime/World/Components/AudioSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ namespace Spartan

}

AudioSource::~AudioSource()
{
Stop();
}

void AudioSource::OnInitialize()
{
Component::OnInitialize();
Expand Down
2 changes: 1 addition & 1 deletion runtime/World/Components/AudioSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Spartan
{
public:
AudioSource(std::weak_ptr<Entity> entity);
~AudioSource() = default;
~AudioSource();

// IComponent
void OnInitialize() override;
Expand Down

0 comments on commit 14a9adb

Please sign in to comment.