summaryrefslogtreecommitdiffstats
path: root/tests/ingen_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ingen_test.cpp')
-rw-r--r--tests/ingen_test.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index 3a566084..f40499b4 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -51,14 +51,14 @@
using namespace std;
using namespace ingen;
-World* world = nullptr;
+unique_ptr<World> world;
static void
ingen_try(bool cond, const char* msg)
{
if (!cond) {
cerr << "ingen: Error: " << msg << endl;
- delete world;
+ world.reset();
exit(EXIT_FAILURE);
}
}
@@ -70,7 +70,7 @@ main(int argc, char** argv)
// Create world
try {
- world = new World(nullptr, nullptr, nullptr);
+ world = unique_ptr<World>{new World(nullptr, nullptr, nullptr)};
world->load_configuration(argc, argv);
} catch (std::exception& e) {
cout << "ingen: " << e.what() << endl;
@@ -218,6 +218,5 @@ main(int argc, char** argv)
// Shut down
world->engine()->deactivate();
- delete world;
return EXIT_SUCCESS;
}