rhythmbox r5988 - in trunk: . bindings/python



Author: jmatthew
Date: Sun Oct 19 21:31:46 2008
New Revision: 5988
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5988&view=rev

Log:
2008-10-20  Jonathan Matthew  <jonathan d14n org>

	* bindings/python/rhythmdb.override:
	Fix wrapper for get_playback_uri - there's no 'db' parameter, and it
	needs to look after the GIL too.


Modified:
   trunk/ChangeLog
   trunk/bindings/python/rhythmdb.override

Modified: trunk/bindings/python/rhythmdb.override
==============================================================================
--- trunk/bindings/python/rhythmdb.override	(original)
+++ trunk/bindings/python/rhythmdb.override	Sun Oct 19 21:31:46 2008
@@ -826,19 +826,20 @@
 override-attr  RhythmDBEntryType_.get_playback_uri
 
 static char*
-_wrap_py_entry_type_get_playback_uri (RhythmDB *db, RhythmDBEntry *entry, PyObject *py_call)
+_wrap_py_entry_type_get_playback_uri (RhythmDBEntry *entry, PyObject *py_call)
 {
+	PyGILState_STATE __py_state;
+	__py_state = pyg_gil_state_ensure();
+
 	if (PyCallable_Check (py_call)) {
 		PyObject *py_ret, *args;
-		PyObject *py_db, *py_entry;
+		PyObject *py_entry;
 		char *ret;
 
-		py_db = pygobject_new (G_OBJECT (db));
 		py_entry = pyg_boxed_new (RHYTHMDB_TYPE_ENTRY, entry, FALSE, FALSE);
-		args = Py_BuildValue ("(OO)", py_db, py_entry);
-		py_ret = PyObject_Call (py_call, args, NULL);
+		args = Py_BuildValue ("(O)", py_entry);
+		py_ret = PyObject_CallObject (py_call, args);
 
-		Py_DECREF (py_db);
 		Py_DECREF (py_entry);
 
 		if (py_ret != Py_None) {
@@ -847,9 +848,11 @@
 			ret = NULL;
 		}
 		Py_DECREF (py_ret);
+		pyg_gil_state_release(__py_state);
 		return ret;
 	} else {
 		/* TODO: emit error */
+		pyg_gil_state_release(__py_state);
 		return NULL;
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]