Skip to content

Commit

Permalink
Try to fix memory leak by deallocating in reverse.
Browse files Browse the repository at this point in the history
Didn't work.
Bug #79 is still present.
  • Loading branch information
Haroldo de Oliveira Pinheiro committed Jan 16, 2023
1 parent 8f46f33 commit 016c10a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/src/vn_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ void bufferResize(int width, int height) {

// Deallocate existing buffers
if (msgLines.lines) {
for (i = 0; i != msgLines.height; i++) {
free(msgLines.lines[i]);
for (i = msgLines.height; i; i--) {
free(msgLines.lines[i - 1]);
}
free(msgLines.lines);
msgLines.lines = 0;
Expand Down

0 comments on commit 016c10a

Please sign in to comment.