function ServiceBag.Destroy(Q)local I=getmetatable(ServiceBag)Q._destroying:Fire()local v=Q._services local X,M=next(v)while M~=nil do v[X]=nil if not(Q._serviceTypesToInitializeSet and Q._serviceTypesToInitializeSet[X])then task.spawn(function()if M.Destroy then M:Destroy()end end)end X,M=next(v)end I.Destroy(Q)end return ServiceBag

function ServiceBag:Destroy()
	local super = getmetatable(ServiceBag)

	self._destroying:Fire()

	local services = self._services
	local key, service = next(services)
	while service ~= nil do
		services[key] = nil

		if not (self._serviceTypesToInitializeSet and self._serviceTypesToInitializeSet[key]) then
			task.spawn(function()
				if service.Destroy then
					service:Destroy()
				end
			end)
		end
		key, service = next(services)
	end

	super.Destroy(self)
end

return ServiceBag
