Patch 7.4.2130
Problem:    Pending timers cause false memory leak reports.
Solution:   Free all timers on exit.
Files:      src/ex_cmds2.c, src/proto/ex_cmds2.pro, src/misc2.c


*** ../vim-7.4.2129/src/ex_cmds2.c      2016-07-29 22:14:39.035998293 +0200
--- src/ex_cmds2.c      2016-07-30 22:39:02.743448954 +0200
***************
*** 1279,1284 ****
--- 1279,1299 ----
      }
      return abort;
  }
+ 
+ #  if defined(EXITFREE) || defined(PROTO)
+     void
+ timer_free_all()
+ {
+     timer_T *timer;
+ 
+     while (first_timer != NULL)
+     {
+       timer = first_timer;
+       remove_timer(timer);
+       free_timer(timer);
+     }
+ }
+ #  endif
  # endif
  
  #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT)
*** ../vim-7.4.2129/src/proto/ex_cmds2.pro      2016-05-31 21:12:59.742705408 
+0200
--- src/proto/ex_cmds2.pro      2016-07-30 22:39:05.243425556 +0200
***************
*** 18,28 ****
  void profile_setlimit(long msec, proftime_T *tm);
  int profile_passed_limit(proftime_T *tm);
  void profile_zero(proftime_T *tm);
! timer_T *create_timer(long msec, int repeats);
  long check_due_timer(void);
  timer_T *find_timer(int id);
  void stop_timer(timer_T *timer);
  int set_ref_in_timer(int copyID);
  void profile_divide(proftime_T *tm, int count, proftime_T *tm2);
  void profile_add(proftime_T *tm, proftime_T *tm2);
  void profile_self(proftime_T *self, proftime_T *total, proftime_T *children);
--- 18,29 ----
  void profile_setlimit(long msec, proftime_T *tm);
  int profile_passed_limit(proftime_T *tm);
  void profile_zero(proftime_T *tm);
! timer_T *create_timer(long msec, int repeat);
  long check_due_timer(void);
  timer_T *find_timer(int id);
  void stop_timer(timer_T *timer);
  int set_ref_in_timer(int copyID);
+ void timer_free_all(void);
  void profile_divide(proftime_T *tm, int count, proftime_T *tm2);
  void profile_add(proftime_T *tm, proftime_T *tm2);
  void profile_self(proftime_T *self, proftime_T *total, proftime_T *children);
*** ../vim-7.4.2129/src/misc2.c 2016-07-16 14:46:51.131240585 +0200
--- src/misc2.c 2016-07-30 22:41:14.550210644 +0200
***************
*** 1224,1229 ****
--- 1224,1232 ----
      channel_free_all();
      job_free_all();
  # endif
+ #ifdef FEAT_TIMERS
+     timer_free_all();
+ #endif
  
      free_termoptions();
  
*** ../vim-7.4.2129/src/version.c       2016-07-30 22:32:08.147330275 +0200
--- src/version.c       2016-07-30 22:47:21.530736394 +0200
***************
*** 765,766 ****
--- 765,768 ----
  {   /* Add new patch number below this line */
+ /**/
+     2130,
  /**/

-- 
FROG: How you English say:  I one more time, mac, I unclog my nose towards
      you, sons of a window-dresser,  so, you think you could out-clever us
      French fellows with your silly knees-bent creeping about advancing
      behaviour.  (blows a raspberry) I wave my private parts at your aunties,
      you brightly-coloured, mealy-templed, cranberry-smelling, electric
      donkey-bottom biters.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui