Received: from www.xshare.com (www.fileseeker.net [212.84.237.17]) by hub.org (8.10.1/8.11.0) with ESMTP id e9G6iKW69215 for ; Mon, 16 Oct 2000 02:44:20 -0400 (EDT) (envelope-from nexus@fileseeker.net) Received: from holodeck.leveld.de ([212.84.237.15] helo=holodeck) by www.xshare.com with smtp (Exim 3.13 #1) id 13l40F-000LK3-00; Mon, 16 Oct 2000 06:44:07 +0000 Message-ID: <003001c0373d$0ff8cbf0$0fed54d4@leveld.de> From: "Oliver Fischer" To: "Alfred Perlstein" Cc: References: <005501c036d4$6e37c810$0fed54d4@leveld.de> <20001015132509.J272@fw.wintelcom.net> Subject: Re: PQclear() causes coredump Date: Mon, 16 Oct 2000 08:48:16 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 x-mimeole: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Archive-Number: 200010/118 X-Sequence-Number: 1475 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" To: "Oliver Fischer" Cc: Sent: Sunday, October 15, 2000 10:25 PM Subject: Re: [INTERFACES] PQclear() causes coredump > * Oliver Fischer [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 >