Dominique Pelle wrote:
> Attached patch fixes 2 bugs with signs and X11 GUIs: > > - The X11 GUI should not allocate the bitmap before calling > XpmReadFileToImage() since XpmReadFileToImage() API > does the memory allocation. As a result, memory for bitmap > is allocated twice (leak) whenever defining a sign with > an xpm icon in the X11 GUIs (athena, neXtaw, motif). > > The following script for example which redefines the > same sign multiple times leaks memory at every iteration > when using GUI X11 athena, neXtaw, motif: > > :while 1 > :sign define foo text=>> texthl=Search icon=foo.xpm > :endwhile > > - The X11 GUI frees memory incorrectly for the icon using > XFree() and vim_free() instead of calling XDestroyImage(). > Using XFree() and vim_free() may possibly do the same > thing as XDestroyImage() but at least not when Vim is > built with -DMEM_PROFILE in which case vim_free() frees > an invalid pointer. > > The XPM documentation indicates that XDestroyImage() should > be used to free the bitmap allocated by XpmReadFileToImage(). > See http://www.cs.ualberta.ca/doc/Software_manuals/xpm.ps > > Patch also frees gui_argv which was never freed. Thanks, I'll include it. -- hundred-and-one symptoms of being an internet addict: 118. You are on a first-name basis with your ISP's staff. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
