Mercurial > pidgin
view finch/libgnt/pygnt/common.c @ 19398:39248f5b53ad
Input handlers are unsigned integers. So set them to 0 instead of -1 after
removing it.
This is a semi-Dj vu of 979d5b68c76417625271f63b5c4fcff37ec38019
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 24 Aug 2007 02:50:55 +0000 |
parents | 5e1412f4e67a |
children |
line wrap: on
line source
#include "common.h" PyObject * create_pyobject_from_string_list(GList *list) { PyObject *py_list; if (list == NULL) { Py_INCREF(Py_None); return Py_None; } if ((py_list = PyList_New(0)) == NULL) { g_list_foreach(list, (GFunc)g_free, NULL); g_list_free(list); return NULL; } while (list) { PyObject *obj = PyString_FromString(list->data); PyList_Append(py_list, obj); Py_DECREF(obj); g_free(list->data); list = g_list_delete_link(list, list); } return py_list; }