don't mangle plugin.get_version() to a tuple of int; it segfaults when the version contains non-ints like '-'

Original commit message from CVS:
don't mangle plugin.get_version() to a tuple of int; it segfaults
when the version contains non-ints like '-'
This commit is contained in:
Thomas Vander Stichele 2005-09-03 10:01:47 +00:00
parent e4ea7ba8bf
commit 61038c89f1
2 changed files with 6 additions and 25 deletions

View file

@ -1,3 +1,9 @@
2005-09-03 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gst.override:
don't mangle plugin.get_version() to a tuple of int; it segfaults
when the version contains non-ints like '-'
2005-09-03 Thomas Vander Stichele <thomas at apestaart dot org>
* testsuite/test_bin.py:

View file

@ -831,32 +831,7 @@ _wrap_gst_tag_setter_get_list(PyGObject *self)
/* pyg_boxed_new handles NULL checking */
return pyg_boxed_new(GST_TYPE_TAG_LIST, ret, TRUE, TRUE);
}
%%
override gst_plugin_get_version noargs
static PyObject *
_wrap_gst_plugin_get_version(PyGObject *self)
{
PyObject *tuple;
const gchar *version;
gchar **items, **p;
gint i = 0;
gint count = 0;
version = gst_plugin_get_version(GST_PLUGIN(self->obj));
items = g_strsplit(version, ".", 4);
for (p = items; *p; ++p) ++count;
tuple = PyTuple_New(count);
for (p = items; *p; ++p) {
PyObject *item;
item = PyInt_FromString(*p, NULL, 10);
PyTuple_SetItem(tuple, i, item);
i++;
}
g_strfreev(items);
return tuple;
}
%%
override gst_element_register kwargs