summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-09-29 09:15:12 (GMT)
committerTobias Markmann <tm@ayena.de>2016-09-29 09:31:53 (GMT)
commitc966e43b2852e69da1ed3cac9e11c1b026d4f4a9 (patch)
tree006ee4058a289a59a6f7fa1604903fd11c2d6d4a /SwifTools
parent871c8955ae39e3eeb76a1bb72bf574764f5c30c3 (diff)
downloadswift-c966e43b2852e69da1ed3cac9e11c1b026d4f4a9.zip
swift-c966e43b2852e69da1ed3cac9e11c1b026d4f4a9.tar.bz2
Fix potential resource leaks
IDGenerator was missing the virtual keyword on its method which is reimplemented by SimpleIDGenerator. Some other classes were missing destructors or virtual destructors. Test-Information: Builds on macOS 10.12 with Qt 5.5.1, all unit tests pass. Change-Id: I482bc249578d38a922256d1fa5241515ce45d0c0
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/UnitTest/SpellParserTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/SwifTools/UnitTest/SpellParserTest.cpp b/SwifTools/UnitTest/SpellParserTest.cpp
index 3148ae6..ccfd7e5 100644
--- a/SwifTools/UnitTest/SpellParserTest.cpp
+++ b/SwifTools/UnitTest/SpellParserTest.cpp
@@ -10,6 +10,8 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/algorithm/string.hpp>
#include <cppunit/extensions/HelperMacros.h>
@@ -26,7 +28,6 @@ class SpellParserTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE_END();
public:
SpellParserTest() {
- parser_ = new SpellParser();
}
void tearDown() {
position_.clear();
@@ -50,7 +51,7 @@ class SpellParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(26, boost::get<1>(position_.back()));
}
private:
- SpellParser *parser_;
+ const std::unique_ptr<SpellParser> parser_ = std::unique_ptr<SpellParser>(new SpellParser());
PositionPairList position_;
};