Using a function like .mkString or .getLines directly on a Source opened by fromFile, fromURL, fromURI will leak the underlying file handle.

Consider using .close() with try / finally to manage the resource's lifetime.