[totem] totem-python-plugin: ensure and release GIL before unrefing python object



commit 11d6c1ba5a3fad3bfb34d44e0a4205025c6c5b69
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]