Use new for arrays with vatriable size (Solaris x86)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 25 Feb 2008 08:31:40 +0000 (08:31 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 25 Feb 2008 08:31:40 +0000 (08:31 +0000)
HLT/comp/AliHLTCOMPHuffmanAltro.cxx

index fb21c82..77f8f73 100644 (file)
@@ -1152,7 +1152,7 @@ Int_t AliHLTCOMPHuffmanAltro::CreateCodeTable()
     }
   
   // initialise leaves of the tree as list (= queue) ofAliHLTCOMPHuffmanData::AliHLTCOMPHuffmanTreeDataStruct,
- AliHLTCOMPHuffmanData::AliHLTCOMPHuffmanTreeDataStruct HuffmanTreeList[filled];
+ AliHLTCOMPHuffmanData::AliHLTCOMPHuffmanTreeDataStruct * HuffmanTreeList = new AliHLTCOMPHuffmanData::AliHLTCOMPHuffmanTreeDataStruct[filled];
   
   // initialise first element
   HuffmanTreeList[0].fleafcontents = HuffmanArraySorted[0];
@@ -1200,6 +1200,8 @@ Int_t AliHLTCOMPHuffmanAltro::CreateCodeTable()
  AliHLTCOMPHuffmanData::AliHLTCOMPHuffmanTreeDataStruct* root = CreateHuffmanTree(HuffmanTreeList, lastelement, filled);
 
   // abort if root = NULL (error already produced in CreateHuffmanTree function)
+ delete [] HuffmanTreeList;
+
   if(root == NULL)
     {
       return 1;