Commit 1a7bb7f8 authored by Mikaël Salson's avatar Mikaël Salson

algo: Memory not properly free-ed with exit()

When calling exit() the memory allocated by the system is not
properly free-ed. This is not really a problem in itself but
Valgrind will complain about that.

There are two solutions:
1. replace exit() with return, but this
   requires to be in the main() function
2. prevent Valgrind from being used in
   other cases (exit because of an error)

See #3031
parent 4764243a
Pipeline #15535 passed with stages
in 21 seconds
!NO_LAUNCHER:
!LAUNCH: (cd $VIDJIL_DIR ; grep './$EXEC ' doc/algo.org > out/doc-examples.sh ; sh out/doc-examples.sh)
# Test examples embedded in 'doc/algo.org'
......
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -g $VIDJIL_DIR/germline/Makefile 2>&1
!EXIT_CODE: 1
......
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS 2>&1
!EXIT_CODE: 1
......
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -x 1 -w -10 -g $VIDJIL_DIR/germline/homo-sapiens.g:IGH $VIDJIL_DATA/Stanford_S22.fasta 2>&1
!EXIT_CODE: 1
......
!NO_LAUNCHER:
!LAUNCH: (cd $VIDJIL_DIR ; ./$EXEC -h 2> out/vidjil-h.txt ; grep '$EXEC -c' out/vidjil-h.txt > out/vidjil-h.sh ; sh out/vidjil-h.sh)
# Test examples embedded in './vidjil-algo -h'
......
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -H 2> out-v ; cat out-v
$ License
......
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -h 2> out-v ; cat out-v
$ License
......
......@@ -111,6 +111,5 @@ int main(int argc, const char** argv)
cout << box_V.refToString(start_V, end_J) << "\t" << box_V << endl ;
cout << box_J.refToString(start_V, end_J) << "\t" << box_J << endl ;
exit (0);
return 0;
}
......@@ -1020,7 +1020,8 @@ int main (int argc, char **argv)
}
delete multigermline;
exit(0);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment