/[PAMELA software]/chewbacca/YodaProfiler/src/PamelaDBOperations.cpp
ViewVC logotype

Diff of /chewbacca/YodaProfiler/src/PamelaDBOperations.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34 by mocchiut, Wed Mar 6 10:12:36 2013 UTC revision 1.35 by mocchiut, Wed Apr 10 08:54:28 2013 UTC
# Line 5449  Int_t PamelaDBOperations::insertTRK_CALI Line 5449  Int_t PamelaDBOperations::insertTRK_CALI
5449    
5450          if ( IsDebug() ) cout << endl << ">>>> TRY TO RECOVER TRACKER CALIBRATIONS <<<<"<<endl;          if ( IsDebug() ) cout << endl << ">>>> TRY TO RECOVER TRACKER CALIBRATIONS <<<<"<<endl;
5451    
5452          TSQLResult *result = 0;          TSQLResult *rresult = 0; // 10RED bug, result is re-used inside result looop...
5453            TSQLResult *result = 0; // 10RED bug, result is re-used inside result looop...
5454          TSQLRow    *row    = 0;          TSQLRow    *row    = 0;
5455          //          //
5456          stringstream oss;          stringstream oss;
# Line 5479  Int_t PamelaDBOperations::insertTRK_CALI Line 5480  Int_t PamelaDBOperations::insertTRK_CALI
5480          oss << " ORDER BY ID DESC LIMIT "<<ncalib<<"; ";                  oss << " ORDER BY ID DESC LIMIT "<<ncalib<<"; ";        
5481          if ( IsDebug() ) cout << oss.str().c_str() << endl;          if ( IsDebug() ) cout << oss.str().c_str() << endl;
5482    
5483          result = conn->Query(oss.str().c_str());          rresult = conn->Query(oss.str().c_str());
5484          if ( !result ) throw -4;;          if ( !result ) throw -4;;
5485          if ( IsDebug() ) cout <<"Rows: "<<result->GetRowCount()<<endl;          if ( IsDebug() ) cout <<"Rows: "<<result->GetRowCount()<<endl;
5486                    
# Line 5488  Int_t PamelaDBOperations::insertTRK_CALI Line 5489  Int_t PamelaDBOperations::insertTRK_CALI
5489          // -----------------------------------          // -----------------------------------
5490          UInt_t nn=0;          UInt_t nn=0;
5491          do {          do {
5492              row = result->Next();              row = rresult->Next();
5493              if(!row)break;              if(!row)break;
5494                            
5495              UInt_t id       = (UInt_t)atoll(row->GetField(0));              UInt_t id       = (UInt_t)atoll(row->GetField(0));
# Line 5668  Int_t PamelaDBOperations::insertTRK_CALI Line 5669  Int_t PamelaDBOperations::insertTRK_CALI
5669                      if(FOUND)break;                      if(FOUND)break;
5670    
5671                  }while(1);//endl loop over root table entries                  }while(1);//endl loop over root table entries
5672                    
5673                    delete result2; // 10RED potential memory leak
5674                  if(FOUND)break;                  if(FOUND)break;
5675    
5676              }//end loop over tables              }//end loop over tables
# Line 5822  Int_t PamelaDBOperations::insertTRK_CALI Line 5824  Int_t PamelaDBOperations::insertTRK_CALI
5824          }while(1);//end loop over calibrations          }while(1);//end loop over calibrations
5825                    
5826                    
5827          if( result )delete result;          if( rresult )delete rresult; // 10RED bug
5828          if( row    )delete row;          if( row    )delete row;
5829                    
5830                    

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.23