Do Scala files need to be released before deleting?
In the code below, if I uncomment the for loop the file no longer gets deleted

    val file = "myfile.csv"
    //for (line <- Source.fromFile(file).getLines()) { }
    new File(file).delete()

If so is there some type of close function that I should be calling?
Do Scala files need to be released before deleting?
===

In the code below, if I uncomment the for loop the file no longer gets deleted

    val file = "myfile.csv"
    //for (line <- Source.fromFile(file).getLines()) { }
    new File(file).delete()

If so is there some type of close function that I should be calling?