mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-06 00:13:33 +00:00
Close file once upload is done.
This commit is contained in:
@@ -489,12 +489,15 @@ namespace MeshCentralRouter
|
|||||||
}
|
}
|
||||||
else if (action == "uploaddone")
|
else if (action == "uploaddone")
|
||||||
{
|
{
|
||||||
|
// Clean up current upload
|
||||||
|
uploadFilePtr = 0;
|
||||||
|
uploadFileSize = 0;
|
||||||
|
if (uploadFileStream != null) { uploadFileStream.Close(); uploadFileStream = null; }
|
||||||
|
|
||||||
|
// Check if another file needs to be uploaded
|
||||||
if (uploadFileArray.Count > uploadFileArrayPtr + 1)
|
if (uploadFileArray.Count > uploadFileArrayPtr + 1)
|
||||||
{
|
{
|
||||||
// Upload the next file
|
// Upload the next file
|
||||||
uploadFilePtr = 0;
|
|
||||||
uploadFileSize = 0;
|
|
||||||
if (uploadFileStream != null) { uploadFileStream.Close(); uploadFileStream = null; }
|
|
||||||
uploadFileArrayPtr++;
|
uploadFileArrayPtr++;
|
||||||
uploadNextFile();
|
uploadNextFile();
|
||||||
}
|
}
|
||||||
@@ -572,6 +575,7 @@ namespace MeshCentralRouter
|
|||||||
|
|
||||||
private void UpdateStatus()
|
private void UpdateStatus()
|
||||||
{
|
{
|
||||||
|
if (this.IsDisposed) return;
|
||||||
if (this.InvokeRequired) { this.Invoke(new UpdateStatusHandler(UpdateStatus)); return; }
|
if (this.InvokeRequired) { this.Invoke(new UpdateStatusHandler(UpdateStatus)); return; }
|
||||||
|
|
||||||
//if (kvmControl == null) return;
|
//if (kvmControl == null) return;
|
||||||
@@ -621,6 +625,28 @@ namespace MeshCentralRouter
|
|||||||
}
|
}
|
||||||
node.fileViewer = null;
|
node.fileViewer = null;
|
||||||
|
|
||||||
|
// Clean up any downloads
|
||||||
|
if (downloadFileStream != null) { downloadFileStream.Close(); downloadFileStream = null; }
|
||||||
|
downloadFilePtr = 0;
|
||||||
|
downloadFileSize = 0;
|
||||||
|
downloadActive = false;
|
||||||
|
downloadStop = false;
|
||||||
|
downloadFileArrayPtr = -1;
|
||||||
|
downloadFileArray = null;
|
||||||
|
downloadLocalPath = null;
|
||||||
|
downloadRemotePath = null;
|
||||||
|
|
||||||
|
// Clean up any uploads
|
||||||
|
uploadActive = false;
|
||||||
|
uploadStop = false;
|
||||||
|
uploadFileArrayPtr = -1;
|
||||||
|
uploadFileArray = null;
|
||||||
|
uploadLocalPath = null;
|
||||||
|
uploadRemotePath = null;
|
||||||
|
uploadFilePtr = 0;
|
||||||
|
uploadFileSize = 0;
|
||||||
|
if (uploadFileStream != null) { uploadFileStream.Close(); uploadFileStream = null; }
|
||||||
|
|
||||||
// Save window location
|
// Save window location
|
||||||
Settings.SetRegValue("filelocation", Location.X + "," + Location.Y + "," + Size.Width + "," + Size.Height);
|
Settings.SetRegValue("filelocation", Location.X + "," + Location.Y + "," + Size.Width + "," + Size.Height);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user