git.videolan.org
/
vlc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python bindings, vlc_instance.c: fix memleak + use PyObject_DEL (patch
[vlc.git]
/
bindings
/
python
/
vlc_instance.c
diff --git
a/bindings/python/vlc_instance.c
b/bindings/python/vlc_instance.c
index
7bdd731
..
fb67db0
100644
(file)
--- a/
bindings/python/vlc_instance.c
+++ b/
bindings/python/vlc_instance.c
@@
-82,9
+82,6
@@
vlcInstance_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
char** ppsz_args = NULL;
int i_size = 0;
char** ppsz_args = NULL;
int i_size = 0;
- self = PyObject_New( vlcInstance, &vlcInstance_Type );
-
-
if( PyArg_ParseTuple( args, "O", &py_list ) )
{
i_size = pyoptions_to_args( py_list, &ppsz_args );
if( PyArg_ParseTuple( args, "O", &py_list ) )
{
i_size = pyoptions_to_args( py_list, &ppsz_args );
@@
-98,6
+95,8
@@
vlcInstance_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
PyErr_Clear( );
}
PyErr_Clear( );
}
+ self = PyObject_New( vlcInstance, &vlcInstance_Type );
+
Py_BEGIN_ALLOW_THREADS
LIBVLC_TRY
LIBVLC_INSTANCE->p_instance = libvlc_new( i_size, ppsz_args, &ex );
Py_BEGIN_ALLOW_THREADS
LIBVLC_TRY
LIBVLC_INSTANCE->p_instance = libvlc_new( i_size, ppsz_args, &ex );
@@
-114,7
+113,7
@@
vlcInstance_dealloc( PyObject *self )
{
libvlc_exception_t ex;
libvlc_destroy( LIBVLC_INSTANCE->p_instance, &ex );
{
libvlc_exception_t ex;
libvlc_destroy( LIBVLC_INSTANCE->p_instance, &ex );
- Py
Mem
_DEL( self );
+ Py
Object
_DEL( self );
}
static PyObject *
}
static PyObject *