Destruct graph module after main() will cause segment fault

Thank you very much.