Code:for(int i=0; i<10000; i++) { // i am neither calling Prepare nor close() on the stmt so ideally it should not hold any open resources right? RSqlStatement stmt; }
Actually, following code snippet is exactly what I am doing in my code, iStmt1, iStmt2, iStmt3 are member variables of the class and are Prepared and kept but stmt0 is not prepared and it is not being closed so I am a little worried whether it will cause any leaks or unclosed resources, as you can see from the code I have no way of closing stmt0 because after the stmt = iStmt1 assignment stmt0 became iStmt1
Code:for( <lot of times>) { RSqlStatement stmt0; RSqlStatement &stmt = stmt0; if( ) { stmt = iStmt1; } else if (){ stmt = iStmt2; } else if() { stmt = iStmt3; } stmt.Next(); // gets the data }
May be I am being a little paranoid here but it is always better to ask, can anyone please answer this question, thanks.




