home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12573 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.8 KB  |  63 lines

  1. Newsgroups: comp.lang.c++
  2. 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
  3. From: pool@cs.utwente.nl (Sander Pool)
  4. Subject: Problem with 'automatic' destructors
  5. Message-ID: <1992Aug19.145847@cs.utwente.nl>
  6. Keywords: destructor
  7. Sender: usenet@cs.utwente.nl
  8. Nntp-Posting-Host: utis116
  9. Organization: University of Twente, Dept. of Computer Science
  10. Date: Wed, 19 Aug 1992 12:58:47 GMT
  11. Lines: 50
  12.  
  13. hello,
  14.  
  15. I'm having a 'little' problem with destructors which are called
  16. automatically when 'exit()' is called. For some reason the object
  17. has turned to garbadge (e.g. the attributes have illegal values)
  18. before the destructor is called. This results in funny/disasterous
  19. situations. xdbx doesn't help much, when I trap the call to the
  20. destructor and try to examine attributes he won't even show them.
  21.  
  22. The class structure looks like this (where Problem is the problem class):
  23.  
  24. class Problem {
  25. public:
  26.     ~Problem(); // this gets called with a bogus object
  27. };
  28.  
  29. class Super {
  30. protected:
  31.     Problem problem;
  32. };
  33.  
  34. class Action: public xview_class, public Super;
  35.  
  36.  
  37. I create an automatic instance of Action like this
  38.  
  39. Action    action;        // obvious :-)
  40.  
  41. and the somewhere in an eventhandler I call 'exit(0)'.
  42.  
  43.  
  44. I'm at a total loss and hope someone can help me out. I
  45. use cfront 2.1 on a Sparc.
  46.  
  47. thanks in advance and regards,
  48.     
  49.     Sander
  50.  
  51. ******************************************************************
  52. Sander O. Pool         Twente University, 
  53.             department of Computer Science 
  54.             SETI group / TRESE project    H303
  55. __________________________________________________________________
  56. address:PO Box 217         | misc.    phone     +31-53-893715
  57.     7500 AE Enschede     |    fax    +31-53-356531
  58.     The Netherlands     |    email     pool@cs.utwente.nl
  59. ******************************************************************
  60.  
  61.  
  62.  
  63.