#include <loc/libloc.h>
#include <loc/as.h>
-#include <loc/stringpool.h>
#include "locationmodule.h"
#include "as.h"
}
static PyObject* AS_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
- // Create stringpool
- struct loc_stringpool* pool;
- int r = loc_stringpool_new(loc_ctx, &pool);
- if (r)
- return NULL;
-
ASObject* self = (ASObject*)type->tp_alloc(type, 0);
- if (self) {
- self->ctx = loc_ref(loc_ctx);
- self->pool = pool;
- }
return (PyObject*)self;
}
if (self->as)
loc_as_unref(self->as);
- if (self->pool)
- loc_stringpool_unref(self->pool);
-
- if (self->ctx)
- loc_unref(self->ctx);
-
Py_TYPE(self)->tp_free((PyObject* )self);
}
return -1;
// Create the AS object
- int r = loc_as_new(self->ctx, self->pool, &self->as, number);
+ int r = loc_as_new(loc_ctx, NULL, &self->as, number);
if (r)
return -1;