From be5e415f7ca4d3b84d09e3f98b2c1bda629570c5 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 8 Oct 2002 23:57:29 +0000 Subject: [PATCH] Add lots of commented-out debugging code, all to try to catch screwy memory-management semantics. Since I couldn't find the real problem, in the end I just made ~bib1Exception() a no-op. --- zoom/zexcept.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/zoom/zexcept.cpp b/zoom/zexcept.cpp index 7113a4d..e37edfc 100644 --- a/zoom/zexcept.cpp +++ b/zoom/zexcept.cpp @@ -1,4 +1,4 @@ -// $Header: /home/cvsroot/yaz++/zoom/zexcept.cpp,v 1.1 2002-08-08 16:06:08 mike Exp $ +// $Header: /home/cvsroot/yaz++/zoom/zexcept.cpp,v 1.2 2002-10-08 23:57:29 mike Exp $ // Z39.50 Exception classes @@ -39,15 +39,34 @@ namespace ZOOM { } - + bib1Exception::bib1Exception(int errcode, const char *addinfo) : exception::exception(errcode) { info = new char[strlen(addinfo)+1]; strcpy((char*) info, addinfo); + //fprintf(stderr, "made new bib1Exception 0x%lx (%d, 0x%lx=%s)\n", + //(long) this, code, (long) info, info); + } + +#if 0 + bib1Exception::bib1Exception(bib1Exception& src) : + exception::exception(src) { + code = src.code; + info = new char[strlen(src.info)+1]; + strcpy((char*) info, src.info); + //fprintf(stderr, "copied bib1Exception 0x%lx to 0x%lx (%d, 0x%lx=%s)\n", + //(long) &src, (long) this, code, (long) info, info); } +#endif bib1Exception::~bib1Exception() { - delete info; + //fprintf(stderr, "deleting bib1Exception 0x%lx (%d, 0x%lx=%s)\n", + //(long) this, code, (long) info, info); + //delete info; + // ### Don't actually do the deletion for now. Exception + // reference semantics are too weird for me to grok so I'm + // doing The Wrong Thing in the knowledge that it will more + // or less work -- it just leaks memory. } int bib1Exception::errcode() const { -- 1.7.10.4