New version of ncurses port applied, fixed memory leak in gutlgrp.cpp.
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
#include <gkbdbase.h>
|
||||
#include <gmemall.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__OS2__)
|
||||
#define INCL_BASE
|
||||
#include <os2.h>
|
||||
@@ -98,12 +100,13 @@ void GKbd::Init() {
|
||||
intrflush(stdscr, FALSE);
|
||||
keypad(stdscr, TRUE);
|
||||
|
||||
// WARNING: this might break with another version of ncurses, or
|
||||
// WARNING: this might break with an old version of ncurses, or
|
||||
// with another implementation of curses. I'm putting it here because
|
||||
// it is quote useful most of the time :-) For other implementations of
|
||||
// curses, you might have to compile curses yourself to achieve this. -jt
|
||||
#if defined(NCURSES_VERSION)
|
||||
ESCDELAY = 50; // ms, slow for a 300bps terminal, fast for humans :-)
|
||||
if(not getenv("ESCDELAY")) // If not specified by user via environment, set
|
||||
ESCDELAY = 50; // ms, slow for a 300bps terminal, fast for humans :-)
|
||||
#endif
|
||||
// For more ncurses-dependent code, look at the gkbd_curstable array
|
||||
// and at the kbxget_raw() function -jt
|
||||
|
@@ -52,7 +52,7 @@ Grp::~Grp() {
|
||||
|
||||
multimap<int, grp_stock>::iterator i;
|
||||
for(currgrp = container.begin(); currgrp != container.end(); currgrp++)
|
||||
for(i = currgrp->second.find(GRP_MEMBER); i != currgrp->second.end(); i++) {
|
||||
for(i = currgrp->second.begin(); i != currgrp->second.end(); i++) {
|
||||
if(i->second.type == TYPE_OBJECT)
|
||||
throw_free(i->second.data.object_item);
|
||||
else if(i->second.type == TYPE_STRING)
|
||||
|
@@ -1361,9 +1361,10 @@ void vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) {
|
||||
// Does anyone know a better solution?
|
||||
|
||||
if(lines >= 0) {
|
||||
if (lines <= 1 + erow - srow) {
|
||||
vatch *buf = vsave (srow + lines, scol, erow, ecol);
|
||||
vrestore (buf, srow, scol, erow - lines, ecol);
|
||||
if(lines <= 1 + erow - srow) {
|
||||
vatch *buf = vsave(srow + lines, scol, erow, ecol);
|
||||
vrestore(buf, srow, scol, erow - lines, ecol);
|
||||
throw_xfree(buf);
|
||||
}
|
||||
else
|
||||
lines = 1 + erow - srow;
|
||||
@@ -1374,9 +1375,10 @@ void vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) {
|
||||
}
|
||||
else {
|
||||
lines*=-1;
|
||||
if (lines <= 1 + erow - srow) {
|
||||
vatch *buf = vsave (srow, scol, erow - lines, ecol);
|
||||
vrestore (buf, srow + lines, scol, erow, ecol);
|
||||
if(lines <= 1 + erow - srow) {
|
||||
vatch *buf = vsave(srow, scol, erow - lines, ecol);
|
||||
vrestore(buf, srow + lines, scol, erow, ecol);
|
||||
throw_xfree(buf);
|
||||
}
|
||||
else
|
||||
lines = 1 + erow - srow;
|
||||
|
Reference in New Issue
Block a user