function Janitor.__index.Cleanup(h)if not h.CurrentlyCleaning then h.CurrentlyCleaning=nil for b,I in next,h do if b==IndicesReference then continue end if I==true then b()else local h=b[I]if h then h(b)end end h[b]=nil end local b=h[IndicesReference]if b then for h in next,b do b[h]=nil end h[IndicesReference]={}end h.CurrentlyCleaning=false end end
--[[**
	Calls each Object's `MethodName` (or calls the Object if `MethodName == true`) and removes them from the Janitor. Also clears the namespace. This function is also called when you call a Janitor Object (so it can be used as a destructor callback).
	@returns [t:void]
**--]]
function Janitor.__index:Cleanup()
	if not self.CurrentlyCleaning then
		self.CurrentlyCleaning = nil
		for Object, MethodName in next, self do
			if Object == IndicesReference then
				continue
			end

			if MethodName == true then
				Object()
			else
				local ObjectMethod = Object[MethodName]
				if ObjectMethod then
					ObjectMethod(Object)
				end
			end

			self[Object] = nil
		end

		local This = self[IndicesReference]
		if This then
			for Index in next, This do
				This[Index] = nil
			end

			self[IndicesReference] = {}
		end

		self.CurrentlyCleaning = false
	end
end
