+ fixed a bug in the C++ interface
[qpalma.git] / QPalmaDP / qpalma_dp.h
index c00788d..134a22e 100644 (file)
@@ -63,7 +63,6 @@ class Alignment {
       int* est_align;
       int* mmatrix_param;
       double* alignmentscores;
-
       double* qualityMatrix;
 
       int dna_len;
@@ -84,7 +83,22 @@ class Alignment {
 
    public:
       Alignment();
-      ~Alignment();
+      ~Alignment() {
+         if(splice_align != 0)
+            delete[] splice_align;
+
+         if(est_align != 0)
+            delete[] est_align;
+
+         if(mmatrix_param != 0)
+            delete[] mmatrix_param;
+
+         if(alignmentscores != 0)
+            delete[] alignmentscores;
+
+         if(qualityMatrix != 0)
+            delete[] qualityMatrix;
+      }
 
 void myalign(int nr_paths_p, char* dna, int dna_len_p, char* est,
       int est_len_p, struct penalty_struct h, double* matchmatrix, int mm_len,