Re: allowing multiple PQclear() calls - Mailing list pgsql-hackers

From Daniele Varrazzo
Subject Re: allowing multiple PQclear() calls
Date
Msg-id CA+mi_8YzRSoZr4d+eFRGGH+WSjj+KU6-stqyckrBEOf-yw+MpQ@mail.gmail.com
Whole thread Raw
In response to Re: allowing multiple PQclear() calls  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-hackers
On Tue, Dec 11, 2012 at 12:43 PM, Josh Kupershmidt <schmiddy@gmail.com> wrote:

> Ah, well. I guess using a macro like:
>
> #define SafeClear(res) do {PQclear(res); res = NULL;} while (0);
>
> will suffice for me.

Psycopg uses:

#define IFCLEARPGRES(pgres)  if (pgres) {PQclear(pgres); pgres = NULL;}

-- Daniele



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: enhanced error fields
Next
From: Heikki Linnakangas
Date:
Subject: Re: [PATCH 02/14] Add support for a generic wal reading facility dubbed XLogReader