Skip to content

Commit bb1dfdf

Browse files
committed
main.cpp: exit gracefully when received SIGINT
delete tlbcontroller calls all the destructor of the objects that were allocated. This also free's all the file descriptor that were allocated to the program hence flushes the output buffered in memory to the output files
1 parent 447eeed commit bb1dfdf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ void sigint_handler(int sig_num)
7070

7171
/* Print Statistics */
7272
tlbcontroller->print_statistics();
73+
/* Clean up memory */
74+
delete tlbcontroller;
7375

7476
std::cout << "Exiting...\n";
7577
exit(EXIT_FAILURE);

0 commit comments

Comments
 (0)