home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!kithrup!stanford.edu!ames!haven.umd.edu!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!utrcu1!infnews!infnews!pool
- From: pool@cs.utwente.nl (Sander Pool)
- Subject: Problem with 'automatic' destructors
- Message-ID: <1992Aug19.145847@cs.utwente.nl>
- Keywords: destructor
- Sender: usenet@cs.utwente.nl
- Nntp-Posting-Host: utis116
- Organization: University of Twente, Dept. of Computer Science
- Date: Wed, 19 Aug 1992 12:58:47 GMT
- Lines: 50
-
- hello,
-
- I'm having a 'little' problem with destructors which are called
- automatically when 'exit()' is called. For some reason the object
- has turned to garbadge (e.g. the attributes have illegal values)
- before the destructor is called. This results in funny/disasterous
- situations. xdbx doesn't help much, when I trap the call to the
- destructor and try to examine attributes he won't even show them.
-
- The class structure looks like this (where Problem is the problem class):
-
- class Problem {
- public:
- ~Problem(); // this gets called with a bogus object
- };
-
- class Super {
- protected:
- Problem problem;
- };
-
- class Action: public xview_class, public Super;
-
-
- I create an automatic instance of Action like this
-
- Action action; // obvious :-)
-
- and the somewhere in an eventhandler I call 'exit(0)'.
-
-
- I'm at a total loss and hope someone can help me out. I
- use cfront 2.1 on a Sparc.
-
- thanks in advance and regards,
-
- Sander
-
- ******************************************************************
- Sander O. Pool Twente University,
- department of Computer Science
- SETI group / TRESE project H303
- __________________________________________________________________
- address:PO Box 217 | misc. phone +31-53-893715
- 7500 AE Enschede | fax +31-53-356531
- The Netherlands | email pool@cs.utwente.nl
- ******************************************************************
-
-
-
-