Skip to content

remove_stopped function doesn't remove stopped #1

Description

@OmarShehata

Whenever I would call "sound:stop()" it would only stop one instance, even if there were many playing. This was apparently due to the remove_stopped function indiscriminately removing sound instances even if they were still playing. A simply check fixed this and now calling stop() stops all playing instances

local function remove_stopped(sources)
local remove = {}
for s in pairs(sources) do
if(s:isStopped())then remove[s] = true end---added the check here
end
for s in pairs(remove) do
sources[s] = nil
end
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions