Close logger and database on exit
Merge branch 'master' into memory_fix
Merge pull request #575 from manupap1/memory_fix

Close logger and database on exit