On Sun, Aug 30, 2009 at 5:33 PM, Ross McFarland<[email protected]> wrote:
> this doesn't have anything to do with stack allocated objects. i went
> through and converted everything to drizzle allocated objects in my
> double-free test case and the exact same problem happens. you can't
> reuse a stack-based or libdrizzle allocated result b/c the connection
> will get two references to it in it's list and then try to free them
> both.
a follow up to this portion after some more experimenting.
it actually doesn't seem to be possible to reuse result objects b/c of
this issue. when i create a result with drizzle_result_create i can't
call drizzle_result free on it between calls to drizzle_query_str with
it or else the object i'm using goes away. there doesn't seem to be a
way get rid of the reference in the connection object without getting
rid of the result object itself. how would language bindings handle
this:
{
DrizzleConnection con;
DrizzleResult r;
...
con.query("select foo", r);
...
// there doesn't seem to be anything i can call here to get the reference to
// the underlying c object in r to be removed from the object under con's
// list
con.query("select bar", r);
...
// con goes out of scope and double free's result
}
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp