fbpad: call scr_free() for the correct terminal
authorAli Gholami Rudi <ali@rudi.ir>
Wed, 5 Dec 2012 14:42:26 +0000 (5 18:12 +0330)
committerAli Gholami Rudi <ali@rudi.ir>
Wed, 5 Dec 2012 14:42:26 +0000 (5 18:12 +0330)
fbpad.c

diff --git a/fbpad.c b/fbpad.c
index 4032a28..4c6a508 100644 (file)
--- a/fbpad.c
+++ b/fbpad.c
@@ -241,7 +241,7 @@ static int poll_all(void)
                if (ufds[i].revents & POLLIN)
                        term_read();
                if (ufds[i].revents & BADPOLLFLAGS) {
-                       scr_free(&terms[cterm()]);
+                       scr_free(&terms[term_idx[i]]);
                        term_end();
                }
                switch_back(term_idx[i]);