X-Git-Url: http://git.indexdata.com/?p=yazpp-moved-to-github.git;a=blobdiff_plain;f=zoom%2Fzexcept.cpp;h=0b0f2ecdd8a6c26170b318fd797ff322834436d0;hp=7113a4d014c5dd71c60d5c2089d0c416bd061ed4;hb=d45d178e35448f9150d03773e7f7281feaa32d75;hpb=7c6295779d21f882f9d53186c5a751cbf86b6c86 diff --git a/zoom/zexcept.cpp b/zoom/zexcept.cpp index 7113a4d..0b0f2ec 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.4 2002-10-11 11:54:05 mike Exp $ // Z39.50 Exception classes @@ -6,7 +6,7 @@ #include // for strerror(), strlen(), strcpy() #include // for sprintf() #include -#include "zoom++.h" +#include "zoom.h" namespace ZOOM { @@ -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 { @@ -71,7 +90,7 @@ namespace ZOOM { } queryException::~queryException() { - delete q; + //delete q; // ### see comment on bib1Exception destructor } int queryException::errcode() const {