summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-01-08 23:42:44 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-01-08 23:42:44 (GMT)
commit43f249445c9c69b9eabeea8be08b6b55a474f1fc (patch)
treed2ef7c1c464c13fb3fbd8c44b233b83a12df09a1 /plugins/pychrysalide/glibext
parent70dce9d37e6b38c5bee7cfe175dcebd021e3a148 (diff)
Fixed the link between native and Python locations.
Diffstat (limited to 'plugins/pychrysalide/glibext')
-rw-r--r--plugins/pychrysalide/glibext/binarycursor.c6
-rw-r--r--plugins/pychrysalide/glibext/binportion.c12
2 files changed, 13 insertions, 5 deletions
diff --git a/plugins/pychrysalide/glibext/binarycursor.c b/plugins/pychrysalide/glibext/binarycursor.c
index 92a4b8c..817cc59 100644
--- a/plugins/pychrysalide/glibext/binarycursor.c
+++ b/plugins/pychrysalide/glibext/binarycursor.c
@@ -109,7 +109,7 @@ static PyObject *py_binary_cursor_new(PyTypeObject *type, PyObject *args, PyObje
static PyObject *py_binary_cursor_update(PyObject *self, PyObject *args)
{
PyObject *result; /* Instance à retourner */
- vmpa2t addr; /* Emplacement fourni */
+ vmpa2t *addr; /* Emplacement fourni */
int ret; /* Bilan de lecture des args. */
GBinaryCursor *cursor; /* Version GLib du type */
@@ -128,11 +128,13 @@ static PyObject *py_binary_cursor_update(PyObject *self, PyObject *args)
cursor = G_BINARY_CURSOR(pygobject_get(self));
- g_binary_cursor_update(cursor, &addr);
+ g_binary_cursor_update(cursor, addr);
result = Py_None;
Py_INCREF(result);
+ clean_vmpa_arg(addr);
+
return result;
}
diff --git a/plugins/pychrysalide/glibext/binportion.c b/plugins/pychrysalide/glibext/binportion.c
index 9ecc1eb..cbf3969 100644
--- a/plugins/pychrysalide/glibext/binportion.c
+++ b/plugins/pychrysalide/glibext/binportion.c
@@ -156,7 +156,7 @@ static PyObject *py_bin_portion_new(PyTypeObject *type, PyObject *args, PyObject
static int py_bin_portion_init(PyObject *self, PyObject *args, PyObject *kwds)
{
const char *code; /* Identifiant de couleur */
- vmpa2t addr; /* Emplacement de portion */
+ vmpa2t *addr; /* Emplacement de portion */
unsigned long long size; /* Taille de la portion */
int ret; /* Bilan de lecture des args. */
PyObject *new_args; /* Nouveaux arguments épurés */
@@ -181,7 +181,11 @@ static int py_bin_portion_init(PyObject *self, PyObject *args, PyObject *kwds)
Py_DECREF(new_kwds);
Py_DECREF(new_args);
- if (ret == -1) return -1;
+ if (ret == -1)
+ {
+ clean_vmpa_arg(addr);
+ return -1;
+ }
/* Eléments de base */
@@ -189,7 +193,9 @@ static int py_bin_portion_init(PyObject *self, PyObject *args, PyObject *kwds)
portion->code = strdup(code);
- init_mrange(&portion->range, &addr, size);
+ init_mrange(&portion->range, addr, size);
+
+ clean_vmpa_arg(addr);
return 0;