home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleaning up at the end to eliminate memory leaks detected by valgrind.
[plomrogue]
/
roguelike.c
diff --git
a/roguelike.c
b/roguelike.c
index 34f3c855da6c9d2927bfad84e73ff11fe207f4e7..6d75aa949ae181b5afd9ac783874905fde314d17 100644
(file)
--- a/
roguelike.c
+++ b/
roguelike.c
@@
-218,7
+218,7
@@
void draw_keys_window (struct Win * win) {
attr_t attri;
int y, x;
char * keyname;
attr_t attri;
int y, x;
char * keyname;
- for (y = 0;
0 != keybindings[offset + y].name
&& y < win->height; y++) {
+ for (y = 0;
y <= keyswindata->max
&& y < win->height; y++) {
attri = 0;
if (y == keyswindata->select - offset) {
attri = A_REVERSE;
attri = 0;
if (y == keyswindata->select - offset) {
attri = A_REVERSE;
@@
-416,5
+416,13
@@
int main () {
update_info (&win_info);
update_log (&win_log, "\nYou wait."); } }
update_info (&win_info);
update_log (&win_log, "\nYou wait."); } }
+ free(map.cells);
+ for (key = 0; key <= world.keyswindata->max; key++)
+ free(world.keybindings[key].name);
+ free(world.keybindings);
+ free(world.keyswindata);
+ free(win_info.data);
+ free(win_log.data);
+
endwin();
return 0; }
endwin();
return 0; }