Henner Zeller <[EMAIL PROTECTED]> writes:
| HI,
| On 7 Mar 2001, Lars Gullik Bjønnes wrote:
| LGBn| Can you redo this now with current cvs? I belive that most of them
| LGBn| should be fixed now. (I know there are some I did not fix...)
|
| Starting and stopping an empty lyx now causes only 852 Bytes memory leak;
|
| The last thing is interesting: there is a delete called on a object not
| allocated with new; I assume the FD_KeyMap is allocated with some xforms
| means and then assigned a scoped_ptr ? Anyway, it _can_ be dangerous to
| allocate someting with malloc() and free it with 'delete'.
You are right, I saw this and then "fixed" it.
| report from LeakTracer as follows:
|
| ------------------------------------------------
| #-- Leak: counted 5x / total Size: 20
| 0x80b2eee is in kb_keymap::defkey(kb_sequence *, int, int) (kbmap.C:223).
| 222 } else {
| 223 (*newone).table = new kb_keymap;
Fixed.
| #-- Leak: counted 1x / total Size: 252
| 0x80bfaed is in LyXGUI::LyXGUI(LyX *, int *, char **, bool) (lyx_gui.C:154).
| 153 // Initialize the LyXColorHandler
| 154 lyxColorHandler = new LyXColorHandler;
Fixed.
| #-- Leak: counted 19x / total Size: 224
| 0x80c09f3 is in flyx_ident_extract(char const *) (lyx_gui_misc.C:209).
| 208
| 209 char * sb = new char[se - sc + 1];
Hmm this is harder...
I am not sure where we should delete this.
| #-- Leak: counted 1x / total Size: 4
| 0x80c181b is in LyX::LyX(int *, char **) (../src/lyx_main.C:81).
| 80 // Global bindings (this must be done as early as possible.) (Lgb)
| 81 toplevel_keymap = new kb_keymap;
Fixed.
| #-- Leak: counted 11x / total Size: 132
| 0x81c9fee is in Menubar::Pimpl::makeMenubar(Menu const &) (Menubar_pimpl.C:135).
| 134
| 135 ItemInfo * iteminfo = new ItemInfo(this,
Fixed.
| #-- Leak: counted 11x / total Size: 220
| 0x81ca003 is in Menubar::Pimpl::makeMenubar(Menu const &) (Menubar_pimpl.C:135).
| 134
| 135 ItemInfo * iteminfo = new ItemInfo(this,
Fixed.
| #-- delete on not allocated memory: counted 1x
| 0x8223386 is in boost::scoped_ptr<FD_KeyMap>::~scoped_ptr(void)
|(../boost/boost/smart_ptr.hpp:87).
| 86 explicit scoped_ptr( T* p=0 ) : ptr(p) {} // never throws
| 87 ~scoped_ptr() { delete ptr; }
| -----------------------
This is probably the FD_keymap.
Fixed.
Just give me time to commit and then you can do this check again :-)
Lgb