Subject: fltk1.1: memory leak - forget destructor in the class Fl_Check_browser 
which must clear the list
Package: fltk1.1
Severity: important
Tags: patch

Run this test program with valgrind :
-------------------- test program
#include <FL/Fl.H>
#include <FL/Fl_Check_Browser.H>
#include <FL/Fl_Double_Window.H>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

int main(int argc, char **argv) {
        Fl_Window window(400,400,"Check_Browser Test");
        Fl_Check_Browser browser(0,0,400,350,0);
        browser.add("abcd");
        browser.add("12345");
        window.resizable(browser);
        window.show(argc,argv);
        return Fl::run();
}
-------------------- end of test program

patch for FL/Fl_Check_Browser.H
-------------------- patch
@@ -67,6 +67,7 @@
   public:

   Fl_Check_Browser(int x, int y, int w, int h, const char *l = 0);
+  ~Fl_Check_Browser() { clear(); }

   int add(char *s);               // add an (unchecked) item
   int add(char *s, int b);        // add an item and set checked
-------------------- end of patch

I send this bug report to www.fltk.org

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to