summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer')
-rw-r--r--Swiften/FileTransfer/FileReadBytestream.cpp11
-rw-r--r--Swiften/FileTransfer/FileWriteBytestream.cpp11
2 files changed, 14 insertions, 8 deletions
diff --git a/Swiften/FileTransfer/FileReadBytestream.cpp b/Swiften/FileTransfer/FileReadBytestream.cpp
index 5885076..4700a9c 100644
--- a/Swiften/FileTransfer/FileReadBytestream.cpp
+++ b/Swiften/FileTransfer/FileReadBytestream.cpp
@@ -1,15 +1,17 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include <boost/filesystem/fstream.hpp>
+#include <Swiften/FileTransfer/FileReadBytestream.h>
+
#include <cassert>
-#include <boost/smart_ptr/make_shared.hpp>
+
+#include <boost/filesystem/fstream.hpp>
#include <boost/numeric/conversion/cast.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
-#include <Swiften/FileTransfer/FileReadBytestream.h>
#include <Swiften/Base/ByteArray.h>
namespace Swift {
@@ -20,6 +22,7 @@ FileReadBytestream::FileReadBytestream(const boost::filesystem::path& file) : fi
FileReadBytestream::~FileReadBytestream() {
if (stream) {
stream->close();
+ delete stream;
stream = NULL;
}
}
diff --git a/Swiften/FileTransfer/FileWriteBytestream.cpp b/Swiften/FileTransfer/FileWriteBytestream.cpp
index 747e1de..bbf3d51 100644
--- a/Swiften/FileTransfer/FileWriteBytestream.cpp
+++ b/Swiften/FileTransfer/FileWriteBytestream.cpp
@@ -1,14 +1,15 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include <boost/filesystem/fstream.hpp>
+#include <Swiften/FileTransfer/FileWriteBytestream.h>
+
#include <cassert>
-#include <boost/numeric/conversion/cast.hpp>
-#include <Swiften/FileTransfer/FileWriteBytestream.h>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/numeric/conversion/cast.hpp>
namespace Swift {
@@ -18,6 +19,7 @@ FileWriteBytestream::FileWriteBytestream(const boost::filesystem::path& file) :
FileWriteBytestream::~FileWriteBytestream() {
if (stream) {
stream->close();
+ delete stream;
stream = NULL;
}
}
@@ -37,6 +39,7 @@ void FileWriteBytestream::write(const std::vector<unsigned char>& data) {
void FileWriteBytestream::close() {
if (stream) {
stream->close();
+ delete stream;
stream = NULL;
}
}