summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis/db/items/comment.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/analysis/db/items/comment.c')
-rw-r--r--plugins/pychrysalide/analysis/db/items/comment.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/pychrysalide/analysis/db/items/comment.c b/plugins/pychrysalide/analysis/db/items/comment.c
index 6d05403..6a9f990 100644
--- a/plugins/pychrysalide/analysis/db/items/comment.c
+++ b/plugins/pychrysalide/analysis/db/items/comment.c
@@ -71,7 +71,7 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject
int repeatable; /* Note une répétition demandée*/
const char *text; /* Eventuel premier commentaire*/
int before; /* Indication sur l'emplacement*/
- vmpa2t addr; /* Emplacement ciblé */
+ vmpa2t *addr; /* Emplacement ciblé */
unsigned long flags; /* Identifiants de ligne visée */
int ret; /* Bilan de lecture des args. */
GDbComment *comment; /* Version GLib du commentaire */
@@ -92,26 +92,34 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject
if (flags > BLF_ALL)
{
+ clean_vmpa_arg(addr);
+
PyErr_SetString(PyExc_ValueError, _("Invalid flag combination"));
return NULL;
+
}
if ((repeatable == -1 && before == -1) || (repeatable != -1 && before != -1))
{
+ clean_vmpa_arg(addr);
+
PyErr_SetString(PyExc_ValueError, _("repeatable or before has to be defined"));
return NULL;
+
}
/* Construction */
if (repeatable)
- comment = g_db_comment_new_inlined(&addr, flags, repeatable);
+ comment = g_db_comment_new_inlined(addr, flags, repeatable);
else
- comment = g_db_comment_new_area(&addr, flags, text, before);
+ comment = g_db_comment_new_area(addr, flags, text, before);
result = pygobject_new(G_OBJECT(comment));
g_object_unref(comment);
+ clean_vmpa_arg(addr);
+
return result;
}