summaryrefslogtreecommitdiff
path: root/lib/CopyJob.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CopyJob.cc')
-rw-r--r--lib/CopyJob.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/CopyJob.cc b/lib/CopyJob.cc
index 864706b..1e151c3 100644
--- a/lib/CopyJob.cc
+++ b/lib/CopyJob.cc
@@ -2,13 +2,21 @@
#include "General.h"
#include "config.h"
-CopyJob::CopyJob(Handle * as, Handle * ad, ssize_t asiz, bool ads) : s(as), d(ad), ds(ads), siz(asiz), cursiz(0), r(0) {
+CopyJob::CopyJob(Handle * as, Handle * ad, ssize_t asiz, bool ads, bool add) : s(as), d(ad), ds(ads), dd(add), siz(asiz), cursiz(0), r(0) {
s->SetNonBlock();
d->SetNonBlock();
WaitFor(s, W4_READING);
}
-CopyJob::~CopyJob() { }
+CopyJob::~CopyJob() {
+ if (ds) {
+ delete s;
+ }
+
+ if (dd) {
+ delete d;
+ }
+}
int CopyJob::Do() throw (GeneralException) {
int tr;
@@ -44,10 +52,6 @@ int CopyJob::Do() throw (GeneralException) {
Suspend(TASK_ON_HOLD);
}
- if (ds) {
- delete s;
- }
-
return TASK_DONE;
}