On Sat, Jun 7, 2008 at 8:18 AM, Dominique Pelle
<[EMAIL PROTECTED]> wrote:

> After installing libxt-dev lesstif2 lesstif2-dev libxpm-dev libxpm4,
> I built Vim-7.1.311 ('huge' with Lesstif GUI) and found a couple of
> minor issues:
>
> - compilation warnings in vim7/src/gui_motif.c
> - crash when exiting Vim & gvim (only when built with -DEXITFREE)
> - memory leak in xsmp_close()

...snip...

> Attached patches:
> - gui_motif.c.patch
> - os_unix.c.patch


In  my last patch "os_unix.c.patch", I had combined together the fix
for the crash and the leak.  For the sake of clarity, I submit them again
as 2 separate patches since they are independent issues.

Attached:
- crash-os_unix.c.patch
- leak-os_unix.c.patch

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: os_unix.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/os_unix.c,v
retrieving revision 1.80
diff -c -r1.80 os_unix.c
*** os_unix.c	7 May 2008 17:07:38 -0000	1.80
--- os_unix.c	7 Jun 2008 06:38:46 -0000
***************
*** 2890,2899 ****
--- 2890,2902 ----
  # if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) || defined(PROTO)
      if (xterm_Shell != (Widget)0)
  	XtDestroyWidget(xterm_Shell);
+ #  if 0
+     /* Lesstif crashes here, lose some memory */
      if (xterm_dpy != NULL)
  	XtCloseDisplay(xterm_dpy);
      if (app_context != (XtAppContext)NULL)
  	XtDestroyApplicationContext(app_context);
+ #  endif
  # endif
  # ifdef FEAT_X11
      if (x11_display != NULL && x11_display != xterm_dpy)
Index: os_unix.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/os_unix.c,v
retrieving revision 1.80
diff -c -r1.80 os_unix.c
*** os_unix.c	7 May 2008 17:07:38 -0000	1.80
--- os_unix.c	7 Jun 2008 06:34:05 -0000
***************
*** 209,214 ****
--- 209,215 ----
  {
      SmcConn smcconn;	    /* The SM connection ID */
      IceConn iceconn;	    /* The ICE connection ID */
+     char *clientid;         /* The client ID for the current smc session */
      Bool save_yourself;     /* If we're in the middle of a save_yourself */
      Bool shutdown;	    /* If we're in shutdown mode */
  } xsmp_config_T;
***************
*** 6557,6563 ****
  xsmp_init(void)
  {
      char		errorstring[80];
-     char		*clientid;
      SmcCallbacks	smcallbacks;
  #if 0
      SmPropValue		smname;
--- 6558,6563 ----
***************
*** 6599,6605 ****
  		     | SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask,
  	    &smcallbacks,
  	    NULL,
! 	    &clientid,
  	    sizeof(errorstring),
  	    errorstring);
      if (xsmp.smcconn == NULL)
--- 6599,6605 ----
  		     | SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask,
  	    &smcallbacks,
  	    NULL,
! 	    &xsmp.clientid,
  	    sizeof(errorstring),
  	    errorstring);
      if (xsmp.smcconn == NULL)
***************
*** 6638,6643 ****
--- 6638,6645 ----
      if (xsmp_icefd != -1)
      {
  	SmcCloseConnection(xsmp.smcconn, 0, NULL);
+ 	vim_free(xsmp.clientid);
+ 	xsmp.clientid = NULL;
  	xsmp_icefd = -1;
      }
  }

Raspunde prin e-mail lui