Skip to content

Commit

Permalink
Closing memory leak in BigWig reader
Browse files Browse the repository at this point in the history
  • Loading branch information
dzerbino committed Dec 26, 2020
1 parent 5a4cdc3 commit 5ca6e17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion TODO.txt
@@ -1,4 +1,3 @@
Hold fire on writers
Seekable apply_paste
Memory tracking & cleaning of chrom labels for text files
Read score in BigBed files? => Handling overlapping iterators with value in unit and filter
Expand Down
4 changes: 3 additions & 1 deletion src/bigBedReader.c
Expand Up @@ -49,8 +49,10 @@ static int readBigBedRegion(BigBedReaderData * data, char * chrom, int start, in
return 0;

while(iter->data) {
if (readIteratorEntries(iter, chrom, data))
if (readIteratorEntries(iter, chrom, data)) {
bwIteratorDestroy(iter);
return 1;
}
iter = bwIteratorNext(iter);
}
bwIteratorDestroy(iter);
Expand Down
4 changes: 3 additions & 1 deletion src/bigWiggleReader.c
Expand Up @@ -56,8 +56,10 @@ static int readBigWiggleRegion(BigWiggleReaderData * data, char * chrom, int sta
return 0;

while(iter->data) {
if (readIteratorIntervals(iter, chrom, data))
if (readIteratorIntervals(iter, chrom, data)) {
bwIteratorDestroy(iter);
return 1;
}
iter = bwIteratorNext(iter);
}
bwIteratorDestroy(iter);
Expand Down

0 comments on commit 5ca6e17

Please sign in to comment.