List:MySQL++« Previous MessageNext Message »
From:Fabio.DAndria Date:December 15 2004 11:55am
Subject:Re: glibc detected double free or corruption
View as plain text  
This helped !!! Thanks so much 

Fabio

>You only have to reset the query object when trying to reuse it.  A 
>newly-created query object is alredy reset.
>
>>                 //executes the query
>>                 Result myResult = myQuery.store();
>>                 return myResult;





Warren Young <mysqlpp@stripped>
15/12/2004 01:35

 
        To:     MySQL++ Mailing List <plusplus@stripped>
        cc: 
        Subject:        Re: glibc detected double free or corruption


Fabio.DAndria@stripped wrote:
> Result CDatabase::ReturnQuery(string query)

It would be more efficient to pass the string as a const reference.  As 
it is, you are copying the string object when calling this function, 
which isn't necessary.

>                 //executes a query and returns a resultset back
>                 Query myQuery = myConn.query();
>                 myQuery.reset();

You only have to reset the query object when trying to reuse it.  A 
newly-created query object is alredy reset.

>                 //executes the query
>                 Result myResult = myQuery.store();
>                 return myResult;

Again, an unnecessary copy here.  Just say "return myQuery.store();"

>         catch (BadQuery er)

Another unnecessary copy.  You can almost always catch exceptions by 
reference.

As for the rest of your code, please reduce it to a simpler example. 
I'm not going to work my way through your threading code just to get to 
the MySQL++ issue underneath, if any.

-- 
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1




Thread
glibc detected double free or corruptionFabio.DAndria14 Dec
  • Re: glibc detected double free or corruptionWarren Young15 Dec
Re: glibc detected double free or corruptionFabio.DAndria15 Dec