Re: allowing multiple PQclear() calls
Marko Kreen <markokr@gmail.com>
From: Marko Kreen <markokr@gmail.com>
To: Josh Kupershmidt <schmiddy@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-12-11T10:39:42Z
Lists: pgsql-hackers
On Tue, Dec 11, 2012 at 6:59 AM, Josh Kupershmidt <schmiddy@gmail.com> wrote: > Would it be crazy to add an "already_freed" flag to the pg_result > struct which PQclear() would set, or some equivalent safety mechanism, > to avoid this hassle for users? Such mechanism already exist - you just need to set your PGresult pointer to NULL after each PQclear(). Later you can safely call PQclear() again on that pointer. -- marko