summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/plugin.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-29 22:30:58 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-29 22:30:58 (GMT)
commit6ba73df8224dc2a88fe5f37a331960936758036e (patch)
tree3db220cc946f3a23887016f3922fe94545e27620 /plugins/pychrysa/plugin.c
parentd91239074b9042988d08093948059096942bdcfc (diff)
Skipped the link to the global reference space when loading plugins.
Diffstat (limited to 'plugins/pychrysa/plugin.c')
-rw-r--r--plugins/pychrysa/plugin.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/pychrysa/plugin.c b/plugins/pychrysa/plugin.c
index 651de7d..7d44f10 100644
--- a/plugins/pychrysa/plugin.c
+++ b/plugins/pychrysa/plugin.c
@@ -71,7 +71,7 @@ static void g_python_plugin_init(GPythonPlugin *);
static bool g_python_plugin_read_interface(GPythonPlugin *);
/* Procède à l'initialisation du greffon. */
-static bool g_python_plugin_do_init(GPythonPlugin *, GObject *);
+static bool g_python_plugin_do_init(GPythonPlugin *);
/* Procède à l'extinction du greffon. */
static bool g_python_plugin_do_exit(GPythonPlugin *, GObject *);
@@ -141,7 +141,6 @@ static void g_python_plugin_init(GPythonPlugin *plugin)
* *
* Paramètres : modname = nom du module à charger. *
* filename = chemin d'accès au code Python à charger. *
-* ref = espace de référencement global. *
* *
* Description : Crée un greffon à partir de code Python. *
* *
@@ -151,7 +150,7 @@ static void g_python_plugin_init(GPythonPlugin *plugin)
* *
******************************************************************************/
-GPluginModule *g_python_plugin_new(const char *modname, const char *filename, GObject *ref)
+GPluginModule *g_python_plugin_new(const char *modname, const char *filename)
{
GPythonPlugin *result; /* Structure à retourner */
PyObject *name; /* Chemin d'accès pour Python */
@@ -346,7 +345,7 @@ GPluginModule *g_python_plugin_new(const char *modname, const char *filename, GO
/* Conclusion */
- if (!g_plugin_module_load(G_PLUGIN_MODULE(result), ref))
+ if (!g_plugin_module_load(G_PLUGIN_MODULE(result)))
goto gppn_bad_plugin;
return G_PLUGIN_MODULE(result);
@@ -485,18 +484,18 @@ static bool g_python_plugin_read_interface(GPythonPlugin *plugin)
* *
******************************************************************************/
-static bool g_python_plugin_do_init(GPythonPlugin *plugin, GObject *ref)
+static bool g_python_plugin_do_init(GPythonPlugin *plugin)
{
bool result; /* Bilan à retourner */
PyObject *args; /* Arguments pour l'appel */
PyObject *value; /* Valeur obtenue */
- args = PyTuple_New(1);
- PyTuple_SetItem(args, 0, pygobject_new(ref));
+ args = Py_None;
+ Py_INCREF(args);
value = run_python_method(plugin->instance, "init", args);
- result = PyObject_IsTrue(value);
+ result = (value != NULL && PyObject_IsTrue(value));
Py_XDECREF(value);
Py_DECREF(args);