1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

31 Commits

Author SHA1 Message Date
Jelmer Vernooij
fdb0aa2b04 Revert broken destructor changes. 2011-01-03 01:48:05 +01:00
Jelmer Vernooij
cbf504b0c5 s4-python: Properly call PyObject_Del from all destructors. 2011-01-03 01:48:04 +01:00
Jelmer Vernooij
5792fa90ac s4-python: Only set BASETYPE flag if subclassing is supported.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Jan  1 03:39:58 CET 2011 on sn-devel-104
2011-01-01 03:39:58 +01:00
Jelmer Vernooij
f5fe9c32ef s4-python: Add more prototypes. 2011-01-01 02:54:05 +01:00
Jelmer Vernooij
4350e0c3c9 s4-python: Properly call PyObject_Del from all destructors. 2011-01-01 02:54:05 +01:00
Jelmer Vernooij
8897935660 pytalloc: Add docstring for talloc.Object.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Dec  5 18:12:59 CET 2010 on sn-devel-104
2010-12-05 18:12:59 +01:00
Jelmer Vernooij
efd8fc0672 pytalloc: Make py_talloc_default_cmp private. 2010-12-01 01:48:25 +01:00
Jelmer Vernooij
b8dc3c8a83 pytalloc: Make py_talloc_dealloc private. 2010-12-01 01:48:25 +01:00
Jelmer Vernooij
4f0436f107 pytalloc: Make py_talloc_default_repr private (now exposed by talloc.Object). 2010-12-01 01:48:25 +01:00
Jelmer Vernooij
e8aa266c97 talloc: Add talloc object.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Nov 30 23:26:56 CET 2010 on sn-devel-104
2010-11-30 23:26:56 +01:00
Jelmer Vernooij
0d6f1a1630 pytalloc: Make some arguments optional. 2010-11-07 01:39:39 +01:00
Jelmer Vernooij
cd172e7724 talloc: Add python talloc module, move convenience functions to it.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Fri Nov  5 02:48:21 UTC 2010 on sn-devel-104
2010-11-05 02:48:21 +00:00
Jelmer Vernooij
4edabb3256 talloc: rename pytalloc.c to pytalloc_util.c 2010-11-05 02:06:06 +00:00
Stefan Metzmacher
177aad556f talloc: pytalloc should not depend on samba specific code
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Oct 24 19:21:25 UTC 2010 on sn-devel-104
2010-10-24 19:21:25 +00:00
Kamen Mazdrashki
c0b9526aaf pytalloc: use talloc_unlink() to free py_talloc objects
Those type of objects are referenced every time we assign
them to other py_talloc objects, which leads to runtime
warnings that we are trying to free an object with references

Wrap talloc_unlink() in SMB_ASSERT() to ensure we catch possible failure

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Wed Oct 20 21:37:06 UTC 2010 on sn-devel-104
2010-10-20 21:37:06 +00:00
Kamen Mazdrashki
76a8ae9e0d pytalloc: Fix warning that we are subtracting void* pointers
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Fri Oct  8 23:36:54 UTC 2010 on sn-devel-104
2010-10-08 23:36:54 +00:00
Jelmer Vernooij
049c4fa04d pytalloc: Add default compare function. 2010-09-21 11:47:03 -07:00
Jelmer Vernooij
a7393449eb pidl: Fix segfault when accessing unicode objects. 2010-09-20 22:40:46 -07:00
Andrew Tridgell
58d92cefe2 pidl-python: cope with NULL pointers in more places
NULL is converted to Py_None
2010-09-02 13:37:07 +10:00
Andrew Tridgell
e7e39584a9 pytalloc: treat a NULL ptr as Py_None 2010-09-02 13:37:07 +10:00
Andrew Tridgell
634e06e465 pytalloc: fixed py_talloc_steal()
py_talloc_steal() was implemented as a macro which evaluated it's 2nd
argument twice. It was often called via a macro with a 2nd argument
that was a function call, for example an allocation in
py_talloc_new(). This meant it allocated memory twice, and leaked one
of them.

This re-implements py_talloc_steal() as a function, so that it only
does the allocation once.
2010-08-25 23:05:05 +10:00
Andrew Tridgell
d78417a5d6 s4-pytalloc: use better names for python talloc objects 2010-08-25 23:05:05 +10:00
Andrew Tridgell
7ed349cace pytalloc: allow for using a system libtalloc-dev with pytalloc
When we have a system talloc library, we still need to grab pytalloc.h
from lib/talloc. We don't want to just use -Ilib/talloc, as otherwise
we'll get the in-tree talloc.h which may not be compatible with the
system talloc.h

So we need to give the path to pytalloc.h
2010-03-29 21:34:29 +11:00
Jelmer Vernooij
c42242d132 s4: Include Python.h early to avoid double definition errors. 2010-01-21 16:15:10 +13:00
Jelmer Vernooij
830adcd58d pidl: Avoid using talloc_free as function pointer, since it may be a
macro.
2009-09-28 15:03:17 +02:00
Jelmer Vernooij
6768cfe624 DCE/RPC(Python): Rename py_talloc_import to py_talloc_steal.
Use py_talloc_reference in DCE/RPC code, fixes
					access to SAMR pipe.
2009-07-30 20:04:42 +02:00
Andrew Tridgell
956b5a0003 fixed use of reference in pytalloc
The previous code caused memory leaks, and also caused situations
where talloc_free could be called on pointers with multiple parents

The new approach is to have two functions:

  py_talloc_import : steals the pointer, so it becomes wholly owned by
                     the python object
  py_talloc_reference: uses a reference, so it is owned by both python
                     and C
2009-07-01 15:15:37 +10:00
Stefan Metzmacher
2f8a398296 lib/talloc: include replace.h in pytalloc.c
This fixes the build on Tru64.

metze
2009-01-30 19:38:09 +01:00
Jelmer Vernooij
86cee0b28c pytalloc: Add some comments, use talloc object location in repr rather
than python object location.
2008-12-23 04:06:21 +01:00
Jelmer Vernooij
2e7a6cb6bf py: Fix initialisation of subtypes, fix segfaults. 2008-12-21 03:08:14 +01:00
Jelmer Vernooij
0f043c197c Move pytalloc to talloc directory. 2008-10-24 02:52:51 +02:00