[opengtl-commits] [305] fix mem leaks

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 305
Author:   cyrille
Date:     2008-07-28 19:32:21 +0200 (Mon, 28 Jul 2008)

Log Message:
-----------
fix mem leaks

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp
    trunk/OpenGTL/TODO


Modified: trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp	2008-07-26 07:28:09 UTC (rev 304)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp	2008-07-28 17:32:21 UTC (rev 305)
@@ -196,7 +196,7 @@
           _valueType->embeddedType(), _allocatedInMemory );
     
     // Create the for statement
-    return CodeGenerator::createIterationForStatement(
+    llvm::BasicBlock* returnBlock = CodeGenerator::createIterationForStatement(
                     _generationContext,
                     _currentBlock,
                     index,
@@ -204,6 +204,8 @@
                     Type::Integer32,
                     bodyBlock,
                     endBodyBlock );
+    delete index;
+    return returnBlock;
 }
 
 llvm::BasicBlock* ArrayVisitor::setSize(GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _size, bool _allocatedInMemory) const
@@ -272,7 +274,7 @@
             sizeAfter, _allocatedInMemory );
     
     // Create the for statement
-    return CodeGenerator::createIterationForStatement(
+    llvm::BasicBlock* returnBB = CodeGenerator::createIterationForStatement(
                     _generationContext,
                     _currentBlock,
                     index,
@@ -280,6 +282,8 @@
                     Type::Integer32,
                     bodyBlock,
                     endBodyBlock );
+    delete index;
+    return returnBB;
   } else {
     std::vector<llvm::Value*> indexes;
     indexes.push_back( llvm::ConstantInt::get(llvm::Type::Int32Ty, 0)); // Access the structure of the array

Modified: trunk/OpenGTL/TODO
===================================================================
--- trunk/OpenGTL/TODO	2008-07-26 07:28:09 UTC (rev 304)
+++ trunk/OpenGTL/TODO	2008-07-28 17:32:21 UTC (rev 305)
@@ -4,6 +4,7 @@
 
 Important TODO
  * access to vector using specific vector instructions
+ * AccessorExpression are leaked
 
 Other:
  * Generate a Doxygen file


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/