X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=aligncommand.h;h=f806c8ded8b6c586e1592b004cd379eda2e79453;hb=60928795782d8f8648ec373d6a96b53032a77429;hp=4e1b8d39f81dc067c60575d1938a21fd1de8dee0;hpb=cbbf2f185fc7289910bb69421095c1de024c5225;p=mothur.git diff --git a/aligncommand.h b/aligncommand.h index 4e1b8d3..f806c8d 100644 --- a/aligncommand.h +++ b/aligncommand.h @@ -177,7 +177,7 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){ } Sequence temp = templateDB->findClosestSequence(candidateSeq); - Sequence* templateSeq = &temp; + Sequence* templateSeq = new Sequence(temp.getName(), temp.getAligned()); float searchScore = templateDB->getSearchScore(); @@ -204,7 +204,7 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){ //rerun alignment Sequence temp2 = templateDB->findClosestSequence(copy); - Sequence* templateSeq2 = &temp2; + Sequence* templateSeq2 = new Sequence(temp2.getName(), temp2.getAligned()); searchScore = templateDB->getSearchScore(); @@ -213,7 +213,8 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){ //check if any better if (copy->getNumBases() > candidateSeq->getNumBases()) { candidateSeq->setAligned(copy->getAligned()); //use reverse compliments alignment since its better - templateSeq = templateSeq2; + delete templateSeq; + templateSeq = templateSeq2; delete nast; nast = nast2; needToDeleteCopy = true; @@ -221,6 +222,7 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){ }else{ wasBetter = "\treverse complement did NOT produce a better alignment so it was not used, please check sequence."; delete nast2; + delete templateSeq2; delete copy; } } @@ -238,6 +240,7 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){ report.print(); delete nast; + delete templateSeq; if (needToDeleteCopy) { delete copy; } pDataArray->count++;