|
Karsten Hopp |
7b8f8e |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
7b8f8e |
Subject: Patch 7.3.1002
|
|
Karsten Hopp |
7b8f8e |
Fcc: outbox
|
|
Karsten Hopp |
7b8f8e |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
7b8f8e |
Mime-Version: 1.0
|
|
Karsten Hopp |
7b8f8e |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
7b8f8e |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
7b8f8e |
------------
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
Patch 7.3.1002
|
|
Karsten Hopp |
7b8f8e |
Problem: Valgrind errors for Python interface.
|
|
Karsten Hopp |
7b8f8e |
Solution: Fix memory leaks when running tests. (ZyX)
|
|
Karsten Hopp |
7b8f8e |
Files: src/if_py_both.h
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
*** ../vim-7.3.1001/src/if_py_both.h 2013-05-21 20:51:55.000000000 +0200
|
|
Karsten Hopp |
7b8f8e |
--- src/if_py_both.h 2013-05-21 22:08:25.000000000 +0200
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 866,871 ****
|
|
Karsten Hopp |
7b8f8e |
--- 866,872 ----
|
|
Karsten Hopp |
7b8f8e |
DICTKEY_UNREF
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
copy_tv(&tv, &di->di_tv);
|
|
Karsten Hopp |
7b8f8e |
+ clear_tv(&tv;;
|
|
Karsten Hopp |
7b8f8e |
return 0;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1129,1134 ****
|
|
Karsten Hopp |
7b8f8e |
--- 1130,1136 ----
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
if (list_append_tv(l, &tv) == FAIL)
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
+ clear_tv(&tv;;
|
|
Karsten Hopp |
7b8f8e |
PyErr_SetVim(_("Failed to add item to list"));
|
|
Karsten Hopp |
7b8f8e |
return -1;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1138,1143 ****
|
|
Karsten Hopp |
7b8f8e |
--- 1140,1146 ----
|
|
Karsten Hopp |
7b8f8e |
li = list_find(l, (long) index);
|
|
Karsten Hopp |
7b8f8e |
clear_tv(&li->li_tv);
|
|
Karsten Hopp |
7b8f8e |
copy_tv(&tv, &li->li_tv);
|
|
Karsten Hopp |
7b8f8e |
+ clear_tv(&tv;;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
return 0;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1204,1212 ****
|
|
Karsten Hopp |
7b8f8e |
--- 1207,1217 ----
|
|
Karsten Hopp |
7b8f8e |
return -1;
|
|
Karsten Hopp |
7b8f8e |
if (list_insert_tv(l, &v, li) == FAIL)
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
+ clear_tv(&v);
|
|
Karsten Hopp |
7b8f8e |
PyErr_SetVim(_("internal error: failed to add item to list"));
|
|
Karsten Hopp |
7b8f8e |
return -1;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
+ clear_tv(&v);
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
return 0;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1346,1352 ****
|
|
Karsten Hopp |
7b8f8e |
--- 1351,1360 ----
|
|
Karsten Hopp |
7b8f8e |
return NULL;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
if (ConvertFromPyObject(selfdictObject, &selfdicttv) == -1)
|
|
Karsten Hopp |
7b8f8e |
+ {
|
|
Karsten Hopp |
7b8f8e |
+ clear_tv(&args);
|
|
Karsten Hopp |
7b8f8e |
return NULL;
|
|
Karsten Hopp |
7b8f8e |
+ }
|
|
Karsten Hopp |
7b8f8e |
selfdict = selfdicttv.vval.v_dict;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1370,1382 ****
|
|
Karsten Hopp |
7b8f8e |
else
|
|
Karsten Hopp |
7b8f8e |
result = ConvertToPyObject(&rettv);
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
- /* FIXME Check what should really be cleared. */
|
|
Karsten Hopp |
7b8f8e |
clear_tv(&args);
|
|
Karsten Hopp |
7b8f8e |
clear_tv(&rettv);
|
|
Karsten Hopp |
7b8f8e |
! /*
|
|
Karsten Hopp |
7b8f8e |
! * if (selfdict!=NULL)
|
|
Karsten Hopp |
7b8f8e |
! * clear_tv(selfdicttv);
|
|
Karsten Hopp |
7b8f8e |
! */
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
return result;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
--- 1378,1387 ----
|
|
Karsten Hopp |
7b8f8e |
else
|
|
Karsten Hopp |
7b8f8e |
result = ConvertToPyObject(&rettv);
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
clear_tv(&args);
|
|
Karsten Hopp |
7b8f8e |
clear_tv(&rettv);
|
|
Karsten Hopp |
7b8f8e |
! if (selfdict != NULL)
|
|
Karsten Hopp |
7b8f8e |
! clear_tv(&selfdicttv);
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
return result;
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1482,1488 ****
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
else if (flags & SOPT_BOOL)
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
! PyObject *r;
|
|
Karsten Hopp |
7b8f8e |
r = numval ? Py_True : Py_False;
|
|
Karsten Hopp |
7b8f8e |
Py_INCREF(r);
|
|
Karsten Hopp |
7b8f8e |
return r;
|
|
Karsten Hopp |
7b8f8e |
--- 1487,1493 ----
|
|
Karsten Hopp |
7b8f8e |
}
|
|
Karsten Hopp |
7b8f8e |
else if (flags & SOPT_BOOL)
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
! PyObject *r;
|
|
Karsten Hopp |
7b8f8e |
r = numval ? Py_True : Py_False;
|
|
Karsten Hopp |
7b8f8e |
Py_INCREF(r);
|
|
Karsten Hopp |
7b8f8e |
return r;
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1492,1498 ****
|
|
Karsten Hopp |
7b8f8e |
else if (flags & SOPT_STRING)
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
if (stringval)
|
|
Karsten Hopp |
7b8f8e |
! return PyBytes_FromString((char *) stringval);
|
|
Karsten Hopp |
7b8f8e |
else
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
PyErr_SetString(PyExc_RuntimeError,
|
|
Karsten Hopp |
7b8f8e |
--- 1497,1507 ----
|
|
Karsten Hopp |
7b8f8e |
else if (flags & SOPT_STRING)
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
if (stringval)
|
|
Karsten Hopp |
7b8f8e |
! {
|
|
Karsten Hopp |
7b8f8e |
! PyObject *r = PyBytes_FromString((char *) stringval);
|
|
Karsten Hopp |
7b8f8e |
! vim_free(stringval);
|
|
Karsten Hopp |
7b8f8e |
! return r;
|
|
Karsten Hopp |
7b8f8e |
! }
|
|
Karsten Hopp |
7b8f8e |
else
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
PyErr_SetString(PyExc_RuntimeError,
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 1516,1524 ****
|
|
Karsten Hopp |
7b8f8e |
int opt_type;
|
|
Karsten Hopp |
7b8f8e |
void *from;
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
! win_T *save_curwin;
|
|
Karsten Hopp |
7b8f8e |
! tabpage_T *save_curtab;
|
|
Karsten Hopp |
7b8f8e |
! buf_T *save_curbuf;
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
VimTryStart();
|
|
Karsten Hopp |
7b8f8e |
switch (opt_type)
|
|
Karsten Hopp |
7b8f8e |
--- 1525,1533 ----
|
|
Karsten Hopp |
7b8f8e |
int opt_type;
|
|
Karsten Hopp |
7b8f8e |
void *from;
|
|
Karsten Hopp |
7b8f8e |
{
|
|
Karsten Hopp |
7b8f8e |
! win_T *save_curwin = NULL;
|
|
Karsten Hopp |
7b8f8e |
! tabpage_T *save_curtab = NULL;
|
|
Karsten Hopp |
7b8f8e |
! buf_T *save_curbuf = NULL;
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
VimTryStart();
|
|
Karsten Hopp |
7b8f8e |
switch (opt_type)
|
|
Karsten Hopp |
7b8f8e |
*** ../vim-7.3.1001/src/version.c 2013-05-21 22:00:42.000000000 +0200
|
|
Karsten Hopp |
7b8f8e |
--- src/version.c 2013-05-21 22:12:54.000000000 +0200
|
|
Karsten Hopp |
7b8f8e |
***************
|
|
Karsten Hopp |
7b8f8e |
*** 730,731 ****
|
|
Karsten Hopp |
7b8f8e |
--- 730,733 ----
|
|
Karsten Hopp |
7b8f8e |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
7b8f8e |
+ /**/
|
|
Karsten Hopp |
7b8f8e |
+ 1002,
|
|
Karsten Hopp |
7b8f8e |
/**/
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
--
|
|
Karsten Hopp |
7b8f8e |
"I've been teaching myself to play the piano for about 5 years and now write
|
|
Karsten Hopp |
7b8f8e |
most of my songs on it, mainly because I can never find any paper."
|
|
Karsten Hopp |
7b8f8e |
Jeff Lynne, ELO's greatest hits
|
|
Karsten Hopp |
7b8f8e |
|
|
Karsten Hopp |
7b8f8e |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
7b8f8e |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
7b8f8e |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
7b8f8e |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|