bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to cleanly quit ?


From: bugzilla
Subject: how to cleanly quit ?
Date: Sun, 9 Aug 2009 23:09:55 -0700 (PDT)

Hi,
I just want to know how can we cleanly quit a ncurses application ?
I noticed (with valgrind) after enwin(); the memory isn't corretly freed.
With a simple "hello world", i've got this:

malloc/free: 202 allocs, 1 frees, 917,187 bytes allocated.
searching for pointers to 201 not-freed blocks.
still reachable: 917,185 bytes in 201 blocks.

Well, now i succeed to have only 21 not-freed blocks with this example:

#include <stdio.h>
#include <stdlib.h>
#include <ncurses.h>

int main ( int argc , char **argv )
{
        WINDOW *ret = initscr ();
        start_color ();
        use_default_colors ();
        printw ( "Hello world!" );
        refresh( );
        getch();
        delwin ( stdscr );
        delwin ( newscr );
        delwin ( curscr );
        endwin ();
        return 0;
}

But i really dislike this 21 blocks of not-freed memory.
-- 
View this message in context: 
http://www.nabble.com/how-to-cleanly-quit---tp24894812p24894812.html
Sent from the Gnu - Ncurses mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]