pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bc68fc3
)
delwin() and dereferencing issue in viewer, #70
author
Michael Göhler
<somebody.here@gmx.de>
Mon, 19 Jan 2015 20:37:58 +0000
(21:37 +0100)
committer
Michael Göhler
<somebody.here@gmx.de>
Mon, 19 Jan 2015 20:37:58 +0000
(21:37 +0100)
src/viewer.c
patch
|
blob
|
history
diff --git
a/src/viewer.c
b/src/viewer.c
index
0e2da58
..
50646d7
100644
(file)
--- a/
src/viewer.c
+++ b/
src/viewer.c
@@
-93,12
+93,12
@@
int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) {
lc = 0;
line = slide->line;
lc = 0;
line = slide->line;
- while(line) {
+ while(line
&& line->text
) {
- if (line
&& line->text && line
->text->text)
+ if (line->text->text)
lc += url_count_inline(line->text->text);
lc += url_count_inline(line->text->text);
- if (line
&& line->text && line
->text->text)
+ if (line->text->text)
line->length -= url_len_inline(line->text->text);
if(line->length > COLS) {
line->length -= url_len_inline(line->text->text);
if(line->length > COLS) {
@@
-415,8
+415,13
@@
int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) {
url_purge();
}
url_purge();
}
+ // disable ncurses
endwin();
endwin();
+ // free ncurses memory
+ delwin(content);
+ delwin(stdscr);
+
return 0;
}
return 0;
}