It's going to be a quick lesson to avoid any memory leaks, so whenever we're generating that create
object neutral, there's a precaution that we should take and that's to avoid any memory leaks.
So using the file value, we're going to check to see if it already exists.
So I'm going to move this actually as a global variable.
And that way, if we create a second file, we can always check to see if the first one exists.
So let's take a look for that before we generate our.
Create object euro and we're going to check to see if file is not equal to null.
So basically, if there is a value for file, then what we want to do is we want to use that window
object you, Earl, and revoke object you URL.
So basically it releases an existing object, your URL that might be there and we're going to revoke
it as file.
So that will give us the ability when we do want to create the new one that we're removing that existing
one.
And we're actually going to place that on neutral instead of file so that you are all needs to be the
one that's the global object, not the file.
So we're checking to see if the Eurail is there.
And if it is, then we're releasing the URL and otherwise we're going to set the URL and then this one
can still have the file within the CSFI.
So within that scope.
There's a URL and this is the revoking of the URL, checking to see if it's available globally and this
is obviously a URL is a window object, so you can include the window as well to make it more exact.
And I'll work the same way.
So let's try that out.
So now when we create the file and we can create another file, we can create another one because it's
constantly releasing the existing one, whereas before if we clicked it, we would only have the one.
So it's a quick fix.
And coming up next, we're going to go back into creating the CSV file.