Skip to content

Commit

Permalink
fixed ssrfinder gc collecte error
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdu committed Oct 17, 2023
1 parent 831e6c5 commit 2860f72
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

Version 1.2.1 (2023-10-17)
--------------------------

- Fixed STRFinder GC collection error

Version 1.2.0 (2023-10-15)
--------------------------
- Fixed repeat search start position
Expand Down
12 changes: 6 additions & 6 deletions src/itr.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,7 @@ static PyObject* pytrf_itrfinder_new(PyTypeObject *type, PyObject *args, PyObjec
return (PyObject *)obj;
}

void pytrf_itrfinder_dealloc(pytrf_ITRFinder *self) {
Py_DECREF(self->seqname);
Py_DECREF(self->seqobj);

self->seq = NULL;

static void pytrf_itrfinder_dealloc(pytrf_ITRFinder *self) {
if (self->motif) {
free(self->motif);
}
Expand All @@ -361,6 +356,11 @@ void pytrf_itrfinder_dealloc(pytrf_ITRFinder *self) {
free(self->boundary);
}

self->seq = NULL;

Py_DECREF(self->seqname);
Py_DECREF(self->seqobj);

Py_TYPE(self)->tp_free((PyObject *)self);
}

Expand Down
8 changes: 3 additions & 5 deletions src/str.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ static PyObject* pytrf_strfinder_new(PyTypeObject *type, PyObject *args, PyObjec
}

static void pytrf_strfinder_dealloc(pytrf_STRFinder *self) {
if (self->boundary) {
free(self->boundary);
}
self->seq = NULL;

Py_DECREF(self->seqname);
Py_DECREF(self->seqobj);
self->seq = NULL;

Py_TYPE(self)->tp_free((PyObject *)self);
}

Expand Down Expand Up @@ -133,7 +131,7 @@ static PyObject* pytrf_strfinder_as_list(pytrf_STRFinder *self) {

//ssr length
int sl;

char motif[7];

Py_ssize_t i;
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define PYTRF_VERSION "1.2.0"
#define PYTRF_VERSION "1.2.1"

0 comments on commit 2860f72

Please sign in to comment.