X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/ledger2?a=blobdiff_plain;f=src%2Fwincontrol.c;h=715aebb4d5d856964e12071630c5bd2ffb0bd10c;hb=b705b99b02a5eeb2b76605fe9b11eb6d5411d6e3;hp=cfa593b42455b81e58dd1ff325c89a128a87d1a9;hpb=244df9d304d76ebbfe62ecfd6201b134a0150025;p=plomrogue diff --git a/src/wincontrol.c b/src/wincontrol.c index cfa593b..715aebb 100644 --- a/src/wincontrol.c +++ b/src/wincontrol.c @@ -15,8 +15,16 @@ -extern struct Win init_win_from_file(struct World * world, char * w_name, - void (* f) (struct Win *)) +extern void free_win(struct Win * win) +{ + free(win->_title); + free(win); +} + + + +extern struct Win * init_win_from_file(struct World * world, char * w_name, + void (* f) (struct Win *)) { char * err = "Trouble in init_win_from_file() with malloc()."; char * prefix = "config/windows/"; @@ -45,8 +53,8 @@ extern struct Win init_win_from_file(struct World * world, char * w_name, exit_err(fclose(file), world, err); struct WinMeta * wmeta = world->wins.meta; - struct Win w; - init_win(wmeta, &w, title, height, width, world, f); + struct Win * w = malloc(sizeof(struct Win)); + init_win(wmeta, w, title, height, width, world, f); free(title); return w; }