Bug fix! Stupid old me forgot to free the 2nd-dimensional pointers; causing memory leaks.
This commit is contained in:
3
torus.c
3
torus.c
@@ -173,6 +173,9 @@ void runner(bool dynamic, bool limit, int frames) {
|
|||||||
for (int i = 0; !limit || i < frames; ++i) {
|
for (int i = 0; !limit || i < frames; ++i) {
|
||||||
if (dynamic && i % 32 == 0 && term_size - terminal_size() != 0) {
|
if (dynamic && i % 32 == 0 && term_size - terminal_size() != 0) {
|
||||||
// Frees the old frame buffer
|
// Frees the old frame buffer
|
||||||
|
for (int i = 0; i < term_size; ++i) {
|
||||||
|
free(buffer[i]);
|
||||||
|
}
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
||||||
// Reallocates the frame buffer as per new terminal size
|
// Reallocates the frame buffer as per new terminal size
|
||||||
|
|||||||
Reference in New Issue
Block a user