summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-08-08 18:24:21 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-08-08 18:24:21 (GMT)
commitc0cc928bfab0af2cdbf16e9a04d41983f4732b93 (patch)
treeeb62ba48bae31886ddad2385c2ccfbc1e002ec6f /plugins/pychrysalide
parent1b7c29ed7dd9561a387be694f09c089e6126716c (diff)
Introduce singletons for operands.
Diffstat (limited to 'plugins/pychrysalide')
-rw-r--r--plugins/pychrysalide/arch/operand.c4
-rw-r--r--plugins/pychrysalide/glibext/singleton.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/pychrysalide/arch/operand.c b/plugins/pychrysalide/arch/operand.c
index 7fa5118..f3eaa27 100644
--- a/plugins/pychrysalide/arch/operand.c
+++ b/plugins/pychrysalide/arch/operand.c
@@ -35,6 +35,7 @@
#include "../access.h"
#include "../helpers.h"
+#include "../glibext/singleton.h"
@@ -768,6 +769,9 @@ bool ensure_python_arch_operand_is_registered(void)
dict = PyModule_GetDict(module);
+ if (!ensure_python_singleton_candidate_is_registered())
+ return false;
+
if (!register_class_for_pygobject(dict, G_TYPE_ARCH_OPERAND, type, &PyGObject_Type))
return false;
diff --git a/plugins/pychrysalide/glibext/singleton.c b/plugins/pychrysalide/glibext/singleton.c
index c4592ac..d00648c 100644
--- a/plugins/pychrysalide/glibext/singleton.c
+++ b/plugins/pychrysalide/glibext/singleton.c
@@ -60,7 +60,7 @@ static gboolean py_singleton_candidate___eq__wrapper(const GSingletonCandidate *
static void py_singleton_candidate_set_ro_wrapper(GSingletonCandidate *);
/* Indique si le candidat est figé. */
-static bool py_singleton_candidate_is_ro_wrapper(GSingletonCandidate *);
+static bool py_singleton_candidate_is_ro_wrapper(const GSingletonCandidate *);
/* Fournit l'empreinte d'un candidat à une centralisation. */
static PyObject *py_singleton_candidate_hash(PyObject *, PyObject *);
@@ -499,7 +499,7 @@ static void py_singleton_candidate_set_ro_wrapper(GSingletonCandidate *candidate
* *
******************************************************************************/
-static bool py_singleton_candidate_is_ro_wrapper(GSingletonCandidate *candidate)
+static bool py_singleton_candidate_is_ro_wrapper(const GSingletonCandidate *candidate)
{
bool result; /* Etat à retourner */
PyGILState_STATE gstate; /* Sauvegarde d'environnement */