bugfix: terminate the program when exiting reader
Merge pull request #817 from chrox/toc_crash_fix

bugfix: terminate the program when exiting reader