From bc0eb8fc577bb8fb284d7ee6b4ba589c792f5427 Mon Sep 17 00:00:00 2001
From: Veronique Legrand <vlegrand@pasteur.fr>
Date: Wed, 12 Mar 2025 11:51:37 +0100
Subject: [PATCH] fixed bug : memory deallocation of cur_fq_record. TODO : take
 some time to make something cleaner on this topic

---
 src/FqBaseBackend.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/FqBaseBackend.h b/src/FqBaseBackend.h
index 7324cec..3ffe196 100644
--- a/src/FqBaseBackend.h
+++ b/src/FqBaseBackend.h
@@ -136,7 +136,10 @@ public:
             free(o_buf);
             o_buf=NULL;
         }
-        delete cur_fq_record;
+        if (cur_fq_record !=NULL) {
+        	delete cur_fq_record;
+        	cur_fq_record=NULL;
+        }
     }
 
     void openInputFile(char * ficname, unsigned char id);
@@ -147,11 +150,7 @@ public:
     void openOutputFile();
     void writeToOutput(const unsigned long&);
     void closeOutputFile();
-    /*void setUndefFile(char * ficname);
-    void openUndefFile();
-    void writeStrToUndefFile(char * start_in_buf, int len);
-    void writeToUndefFile(const T_buf_info& buf_info,const int& addCR=0);
-    void closeUndefFile();*/
+
 
     static void setQualThreshold(const FasqQualThreshold& a_qual_thres){
         FqBaseBackend::qual_thres.min_correct_k_mers_in_read=a_qual_thres.min_correct_k_mers_in_read;
-- 
GitLab