Compilation error with -D EXITFREE

2007-02-04 Thread Alexei Alexandrov
Hi All!

Do I understand it correct that EXITFREE define in Vim source code can be used 
to make sure all resources are cleaned up on exit (and those which are not 
should be treated as leaks)? To be able to use it on Windows I had to do the 
following changes:

Index: misc2.c
===
--- misc2.c (revision 205)
+++ misc2.c (working copy)
@@ -1075,7 +1075,7 @@
 ResetRedobuff();
 ResetRedobuff();
 
-#ifdef FEAT_CLIENTSERVER
+#if defined(FEAT_CLIENTSERVER)  defined(FEAT_X11)
 vim_free(serverDelayedStartName);
 #endif
 
Index: os_mswin.c
===
--- os_mswin.c (revision 205)
+++ os_mswin.c (working copy)
@@ -239,6 +239,11 @@
 
 if (gui.in_use)
  gui_exit(r);
+
+#ifdef EXITFREE
+free_all_mem();
+#endif
+
 exit(r);
 }

-- 
Alexei Alexandrov


Re: Compilation error with -D EXITFREE

2007-02-04 Thread Bram Moolenaar

Alexei Alexandrov wrote:

 Do I understand it correct that EXITFREE define in Vim source code can
 be used to make sure all resources are cleaned up on exit (and those
 which are not should be treated as leaks)? To be able to use it on
 Windows I had to do the following changes:

Thanks for the patch.  I never tried EXITFREE on Win32.  What memory
checker to you use with it?  Aren't there Win32-specific things that
need to be freed?

-- 
From know your smileys:
 (:-#   Said something he shouldn't have

 /// 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///