Re: libpq++ tracing considered harmful (was Re: libpq++ memory problems) - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: libpq++ tracing considered harmful (was Re: libpq++ memory problems)
Date
Msg-id 18276.958489900@sss.pgh.pa.us
Whole thread Raw
In response to libpq++ memory problems  (Tim Brookes <tim.brookes@mcmail.com>)
List pgsql-interfaces
Tim Brookes <tim.brookes@mcmail.com> writes:
> The code is simply a constructor and destructor call of PgDatabase,
> called in succession, within an endless loop to emphasise the issue.
> But you're right, something isn't being released - within the
> destructor.

All I can say is, I see absolutely zero leakage with 7.0 code and the
attached test program.  Are you sure you didn't link a 6.5 library
by mistake, or something like that?
        regards, tom lane


#include <iostream.h>
#include <libpq++.h>

int main()
{ for (int i = 0; i < 10000; i++) {   // Open the connection to the database and make sure it's OK   PgDatabase
data("dbname=template1user=postgres");   if ( data.ConnectionBad() ) {     cout << "Connection was unsuccessful..." <<
endl         << "Error message returned: " << data.ErrorMessage() << endl;     return 1;   } } return 0;
 
} // End main()


pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq++ tracing considered harmful (was Re: libpq++ memory problems)
Next
From: Steve Wampler
Date:
Subject: Detecting presence of database through JDBC?