From: Arvin Schnell Date: Tue, 14 Aug 2012 12:24:17 +0000 (+0200) Subject: - don't use factory X-Git-Tag: v0.1.3~154 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a07ba241e2457fb45b360ef6c9a2302e884573d4;p=thirdparty%2Fsnapper.git - don't use factory --- diff --git a/examples/Create.cc b/examples/Create.cc index b509c37d..4a2a4a36 100644 --- a/examples/Create.cc +++ b/examples/Create.cc @@ -2,7 +2,6 @@ #include #include -#include #include using namespace snapper; @@ -11,9 +10,11 @@ using namespace std; int main(int argc, char** argv) { - Snapper* sh = createSnapper(); + Snapper* sh = new Snapper(); sh->createSingleSnapshot("test"); + delete sh; + exit(EXIT_SUCCESS); } diff --git a/examples/CreateTimeline.cc b/examples/CreateTimeline.cc index 468d9629..d811710f 100644 --- a/examples/CreateTimeline.cc +++ b/examples/CreateTimeline.cc @@ -3,7 +3,6 @@ #include #include -#include #include using namespace snapper; @@ -13,7 +12,7 @@ using namespace std; void deleteAll() { - Snapper* sh = createSnapper("testsuite"); + Snapper* sh = new Snapper("testsuite"); Snapshots snapshots = sh->getSnapshots(); @@ -25,7 +24,7 @@ deleteAll() for (vector::iterator it = tmp.begin(); it != tmp.end(); ++it) sh->deleteSnapshot(*it); - deleteSnapper(sh); + delete sh; } @@ -34,7 +33,7 @@ main() { deleteAll(); - Snapper* sh = createSnapper("testsuite"); + Snapper* sh = new Snapper("testsuite"); time_t t = time(NULL) - 100 * 24*60*60; while (t < time(NULL)) @@ -46,7 +45,7 @@ main() t += 60*60; } - deleteSnapper(sh); + delete sh; exit(EXIT_SUCCESS); } diff --git a/examples/List.cc b/examples/List.cc index cbc8d758..58999ee7 100644 --- a/examples/List.cc +++ b/examples/List.cc @@ -2,7 +2,6 @@ #include #include -#include #include using namespace snapper; @@ -11,7 +10,7 @@ using namespace std; int main(int argc, char** argv) { - Snapper* sh = createSnapper(); + Snapper* sh = new Snapper(); const Snapshots& snapshots = sh->getSnapshots(); for (Snapshots::const_iterator it = snapshots.begin(); it != snapshots.end(); ++it) @@ -19,5 +18,7 @@ main(int argc, char** argv) cout << *it << endl; } + delete sh; + exit(EXIT_SUCCESS); } diff --git a/examples/ListAll.cc b/examples/ListAll.cc index 140bb74f..ac04419f 100644 --- a/examples/ListAll.cc +++ b/examples/ListAll.cc @@ -2,7 +2,6 @@ #include #include -#include #include using namespace snapper; diff --git a/examples/SnapTest.cc b/examples/SnapTest.cc index bc470cc6..4cfa2e09 100644 --- a/examples/SnapTest.cc +++ b/examples/SnapTest.cc @@ -2,7 +2,6 @@ #include #include -#include #include #include #include