function Trove.Clean(q)for B,j in ipairs(q._objects)do q:_cleanupObject(j[1],j[2])end table.clear(q._objects)end function Trove._cleanupObject(j,q,B)if B==FN_MARKER then q()elseif B==THREAD_MARKER then coroutine.close(q)else q[B](q)end end
--[=[
	Cleans up all objects in the trove. This is
	similar to calling `Remove` on each object
	within the trove.
]=]
function Trove:Clean()
	for _, obj in ipairs(self._objects) do
		self:_cleanupObject(obj[1], obj[2])
	end
	table.clear(self._objects)
end

function Trove:_cleanupObject(object, cleanupMethod)
	if cleanupMethod == FN_MARKER then
		object()
	elseif cleanupMethod == THREAD_MARKER then
		coroutine.close(object)
	else
		object[cleanupMethod](object)
	end
end
