Re: allowing multiple PQclear() calls

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: Boszormenyi Zoltan <zb(at)cybertec(dot)at>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Marko Kreen <markokr(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: allowing multiple PQclear() calls
Date: 2012-12-11 13:15:27
Message-ID: CA+mi_8YzRSoZr4d+eFRGGH+WSjj+KU6-stqyckrBEOf-yw+MpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 11, 2012 at 12:43 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-12-11 13:55:35 Re: [PATCH 02/14] Add support for a generic wal reading facility dubbed XLogReader
Previous Message Pavel Stehule 2012-12-11 13:05:30 Re: enhanced error fields