Bug fix! Stupid old me forgot to free the 2nd-dimensional pointers; causing memory leaks.

This commit is contained in:
Arkaprabha Chakraborty
2023-05-30 01:50:15 +05:30
parent b98e4ede8f
commit 77183303e3

View File

@@ -173,6 +173,9 @@ void runner(bool dynamic, bool limit, int frames) {
for (int i = 0; !limit || i < frames; ++i) {
if (dynamic && i % 32 == 0 && term_size - terminal_size() != 0) {
// Frees the old frame buffer
for (int i = 0; i < term_size; ++i) {
free(buffer[i]);
}
free(buffer);
// Reallocates the frame buffer as per new terminal size