[8744] Fix 'warning: deleting ‘void*’ is undefined' in SqlOperations.h/SqlOperations.cpp, caused by [8736]. Thanks to Shendor for pointing the problem.

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2009-10-27 11:41:53 +02:00
parent a4e3b3e6aa
commit 190c5e6338
4 changed files with 10 additions and 13 deletions

View file

@ -36,22 +36,22 @@ void SqlTransaction::Execute(Database *db)
db->DirectExecute("START TRANSACTION");
while(!m_queue.empty())
{
char const *sql = m_queue.front();
char *sql = const_cast<char*>(m_queue.front());
m_queue.pop();
if(!db->DirectExecute(sql))
{
delete [] ((void*)const_cast<char*>(sql));
delete [] sql;
db->DirectExecute("ROLLBACK");
while(!m_queue.empty())
{
delete [] ((void*)const_cast<char*>(m_queue.front()));
delete [] (const_cast<char*>(m_queue.front()));
m_queue.pop();
}
return;
}
delete [] ((void*)const_cast<char*>(sql));
delete [] sql;
}
db->DirectExecute("COMMIT");
}
@ -141,7 +141,7 @@ QueryResult* SqlQueryHolder::GetResult(size_t index)
/// the query strings are freed on the first GetResult or in the destructor
if(m_queries[index].first != NULL)
{
delete [] ((void*)(const_cast<char*>(m_queries[index].first)));
delete [] (const_cast<char*>(m_queries[index].first));
m_queries[index].first = NULL;
}
/// when you get a result aways remember to delete it!
@ -166,7 +166,7 @@ SqlQueryHolder::~SqlQueryHolder()
/// results used already (getresult called) are expected to be deleted
if(m_queries[i].first != NULL)
{
delete [] ((void*)(const_cast<char*>(m_queries[i].first)));
delete [] (const_cast<char*>(m_queries[i].first));
if(m_queries[i].second)
delete m_queries[i].second;
}