home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2064 < prev    next >
Encoding:
Text File  |  1992-07-22  |  2.0 KB  |  54 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!wupost!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!math.fu-berlin.de!zrz.tu-berlin.de!mailgzrz.tu-berlin.de!nickel
  3. From: nickel@cs.tu-berlin.de (Juergen Nickelsen)
  4. Subject: cleanup on exit (Was Re: Chasing memory leaks: tools, procedures?)
  5. In-Reply-To: fjh@munta.cs.mu.OZ.AU's message of Tue, 21 Jul 1992 14:27:02 GMT
  6. Message-ID: <NICKEL.92Jul22200234@desaster.cs.tu-berlin.de>
  7. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  8. Nntp-Posting-Host: desaster.cs.tu-berlin.de
  9. Reply-To: nickel@cs.tu-berlin.de
  10. Organization: STONE Project, Technical University of Berlin, Germany
  11. References: <1992Jul6.093355.20442@lth.se>
  12.     <1992Jul18.203518.14496@murdoch.acc.Virginia.EDU>
  13.     <1992Jul19.160323.8820@organpipe.uug.arizona.edu>
  14.     <NICKEL.92Jul19184631@desaster.cs.tu-berlin.de>
  15.     <9220400.530@mulga.cs.mu.OZ.AU>
  16. Date: Wed, 22 Jul 1992 19:02:34 GMT
  17. Lines: 35
  18.  
  19. In article <9220400.530@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU
  20. (Fergus James HENDERSON) writes:
  21.  
  22. > nickel@cs.tu-berlin.de (Juergen Nickelsen) writes:
  23. [...]
  24. > >To make this more useful, must_alloc() should also call some
  25. > >cleanup-function. For some application it is a must to have control of
  26. > >their termination, e.g. to remove temporary files, re-rename
  27. > >temporarily renamed files etc.
  28. > Why not just use at_exit() to install an error handler if necessary?
  29.  
  30. I would really *like* to use it, but it's not portable. SunOS has a
  31. function
  32.  
  33.     int on_exit(procp, arg)
  34.  
  35. , but the manual page says
  36.  
  37.     NOTES
  38.      This call is specific to  the  SunOS  operating  system  and
  39.      should not be used if portability is a concern.
  40.  
  41. POSIX doesn't define something like this, SysV.3, BSD 4.3, and Ultrix
  42. don't seem to have somthing like that.
  43.  
  44. "Historical" Note:
  45. With VAX C on VMS, at_exit() (or atexit() ?) was fun, since the
  46. installed exit handler was executed even when the program had been
  47. interrupted and the user started another one. (The program image was
  48. still considered running then, if it hadn't been explicitely removed
  49. with "stop".) Caused lots of user confusion.
  50.  
  51. --
  52. Juergen Nickelsen
  53.