[totem/gnome-2-28] totem-python-plugin: ensure and release GIL before unrefing python object
- From: Tim-Philipp Müller <tpm src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [totem/gnome-2-28] totem-python-plugin: ensure and release GIL before unrefing python object
- Date: Thu, 1 Oct 2009 12:28:16 +0000 (UTC)
commit b51aeaa5c559c2cfa3acf27166ca004c131d0dc0
Author: Alessandro Decina <alessandro decina collabora co uk>
Date: Wed Sep 30 18:33:48 2009 +0100
totem-python-plugin: ensure and release GIL before unrefing python object
Should fix 'Fatal Python error: PyEval_SaveThread: NULL tstate' error
when closing totem with the BBC plugin loaded. Might happen with other
python plugins as well.
Fixes #593967.
src/plugins/totem-python-plugin.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/totem-python-plugin.c b/src/plugins/totem-python-plugin.c
index 8bf8955..5457e29 100644
--- a/src/plugins/totem-python-plugin.c
+++ b/src/plugins/totem-python-plugin.c
@@ -214,7 +214,11 @@ totem_python_object_finalize (GObject *object)
g_debug ("Finalizing Python plugin instance");
if (((TotemPythonObject *) object)->instance) {
+ PyGILState_STATE state;
+
+ state = pyg_gil_state_ensure();
Py_DECREF (((TotemPythonObject *) object)->instance);
+ pyg_gil_state_release (state);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]