Skip to content

Commit 4dfd5f3

Browse files
author
nils-hamel
committed
Adding object formal deletion in framework main function
1 parent c734e32 commit 4dfd5f3

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/framework.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ int main(int argc, char ** argv){
8888
// Framework front-end
8989
Frontend * frontend(nullptr);
9090

91+
// Framework data source
92+
ViewPointSource * viewpointsource(nullptr);
93+
9194
// Pipeline iterations
9295
int loopMajor(database.getGroup());
9396
int loopMinor(0);
@@ -118,7 +121,7 @@ int main(int argc, char ** argv){
118121
std::string lastFile = yamlFrontend["last" ].IsDefined() ? yamlFrontend["last" ].as<std::string>() : "";
119122

120123
// Front-end source
121-
ViewPointSource * viewpointsource = new ViewPointSourceFs(
124+
viewpointsource = new ViewPointSourceFs(
122125
yamlFrontend["image"].as<std::string>(),
123126
firstFile,
124127
lastFile,
@@ -146,7 +149,7 @@ int main(int argc, char ** argv){
146149
std::string lastFile = yamlFrontend["last" ].IsDefined() ? yamlFrontend["last" ].as<std::string>() : "";
147150

148151
// Front-end source
149-
ViewPointSource * viewpointsource = new ViewPointSourceWithOdometry(
152+
viewpointsource = new ViewPointSourceWithOdometry(
150153
yamlFrontend["image"].as<std::string>(),
151154
yamlExport["path"].as<std::string>() + "/sparse_transformation.dat",
152155
firstFile,
@@ -186,9 +189,8 @@ int main(int argc, char ** argv){
186189
}
187190
}
188191

189-
// Wait bootstrap image count
192+
// Start optimisation only if sufficient amount of view are pushed
190193
if(database.getBootstrap()){
191-
// avoid optimisation
192194
continue;
193195
}
194196

@@ -299,9 +301,11 @@ int main(int argc, char ** argv){
299301

300302
}
301303

302-
// Need release of :
303-
// ViewPointSource * source = NULL;
304-
// Frontend * frontend(nullptr);
304+
// Delete frontend object
305+
delete frontend;
306+
307+
// Delete viewpointsource object
308+
delete viewpointsource;
305309

306310
// system message
307311
return 0;

0 commit comments

Comments
 (0)