Re: PQclear() causes coredump - Mailing list pgsql-interfaces

From Oliver Fischer
Subject Re: PQclear() causes coredump
Date
Msg-id 003001c0373d$0ff8cbf0$0fed54d4@leveld.de
Whole thread Raw
In response to PQclear() causes coredump  ("Oliver Fischer" <nexus@fileseeker.net>)
List pgsql-interfaces
Hy,

I found the bug this night. The reason was the call to PQclear()
in the destructor of my class. In some places I used a assingment
like:

QtResultSet obj = otherQtResultSetObj;

So, the destruktor of otherQtResultObj was called. The coredump
occured within obj when PQclaer was called another time.

Byem

Oliver

----- Original Message -----
From: "Alfred Perlstein" <bright@wintelcom.net>
To: "Oliver Fischer" <nexus@fileseeker.net>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Sunday, October 15, 2000 10:25 PM
Subject: Re: [INTERFACES] PQclear() causes coredump


> * Oliver Fischer <nexus@fileseeker.net> [001015 11:19] wrote:
> > Hi Folks,
> >
> > I write a program in c++ using PostgreSQL 7.0 at the moment.
> > During this, I have
> > written some small classes for accessing the database. One of
> > this classes is QtResultSet. I use them to manage my
statments.
> >
> > To avoid memory leaks, I use the dtor to free the resultset
with
> > PQclear(). Unfortunaly every call to PQclear causes a
coredump.
> > What is my mistake?
> >
> > === QtResultSet.h ===
>
> [snip]
>
> Perhaps you can post us a traceback from your coredump?  If you
could
> also give a relatively simple way to reproduce the bug with a
driver
> program that uses your class it would be helpful.
>
> -Alfred
>



pgsql-interfaces by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: PQclear() causes coredump
Next
From: Michael Meskes
Date:
Subject: Re: STRANGE ecpg OUTPUT