Skip to content
Snippets Groups Projects
Commit 1b03979e authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Initialize RoboCommand object only when a transfer starts.

Currently there are no references to the object before a transfer has
started, so it is safe to only initialize it in the StartTransfer()
method.
parent 0c6c99d9
No related branches found
No related tags found
No related merge requests found
......@@ -189,11 +189,8 @@ namespace ATxService
/// </summary>
private void LoadSettings() {
try {
LoadConfigXml();
LoadStatusXml();
_roboCommand = new RoboCommand();
}
catch (Exception ex) {
Log.Error("LoadSettings() failed: {0}\n{1}", ex.Message, ex.StackTrace);
......
......@@ -21,6 +21,7 @@ namespace ATxService
if (_transferState != TxState.Stopped)
return;
_roboCommand = new RoboCommand();
_status.CurrentTransferSrc = sourcePath;
_status.CurrentTransferSize = FsUtils.GetDirectorySize(sourcePath);
......@@ -163,7 +164,6 @@ namespace ATxService
_txCurFileSize = 0;
_txCurFileProgress = 0;
_roboCommand.Dispose();
_roboCommand = new RoboCommand();
_status.TransferInProgress = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment