Fix window memory allocation bug.

This commit is contained in:
Adam Harrison 2024-06-23 11:14:57 -04:00 committed by Takase
parent 7ca4c948bf
commit 1a293cd42e
1 changed files with 1 additions and 1 deletions

View File

@ -519,7 +519,7 @@ void ren_draw_rect(RenSurface *rs, RenRect rect, RenColor color) {
/*************** Window Management ****************/
static void ren_add_window(RenWindow *window_renderer) {
window_count += 1;
window_list = realloc(window_list, window_count);
window_list = realloc(window_list, window_count * sizeof(RenWindow*));
window_list[window_count-1] = window_renderer;
}