X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=inline;f=src%2Fwindows.c;h=389637b31b357e19bf6dfa886db749b257b944ca;hb=e505542d10413b5cf94edda90bdc793a48db9385;hp=f75544bd4753fa06d64f46382499a8b92f7fbfec;hpb=0399a31b31047ab82348f733d6c56524258d1188;p=plomrogue
diff --git a/src/windows.c b/src/windows.c
index f75544b..389637b 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -362,8 +362,9 @@ static void shift_win_backward(struct WinMeta * wmeta)
-extern uint8_t init_win_meta(WINDOW * screen, struct WinMeta * wmeta)
+extern uint8_t init_win_meta(WINDOW * screen, struct WinMeta ** wmp)
{
+ struct WinMeta * wmeta = malloc(sizeof(struct WinMeta));
wmeta->_screen = screen;
uint32_t maxy_test = getmaxy(screen);
uint32_t maxx_test = getmaxx(screen);
@@ -383,6 +384,7 @@ extern uint8_t init_win_meta(WINDOW * screen, struct WinMeta * wmeta)
}
wmeta->padframe.curses_win = pad_test;
wmeta->active = 0;
+ *wmp = wmeta;
return 0;
}
@@ -438,8 +440,20 @@ extern uint8_t init_win(struct WinMeta * wmeta, struct Win ** wp, char * title,
+extern void free_winmeta(struct WinMeta * wmeta)
+{
+ delwin(wmeta->padframe.curses_win);
+ free(wmeta);
+}
+
+
+
extern void free_win(struct Win * win)
{
+ if (0 != win->frame.curses_win)
+ {
+ delwin(win->frame.curses_win);
+ }
free(win->_title);
free(win);
}