home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleaned up memory allocation by Win initialization.
[plomrogue]
/
src
/
wincontrol.c
diff --git
a/src/wincontrol.c
b/src/wincontrol.c
index cfa593b42455b81e58dd1ff325c89a128a87d1a9..715aebb4d5d856964e12071630c5bd2ffb0bd10c 100644
(file)
--- 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/";
{
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;
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;
}
free(title);
return w;
}