home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18659 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  1.2 KB

  1. From: Neal.Sanche@ttlg.UUCP (Neal Sanche)
  2. Sender: postmaster@ttlg.UUCP
  3. Path: sparky!uunet!spool.mu.edu!yale.edu!yale!gumby!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!alberta!nebulus!ttlg!postmaster
  4. Newsgroups: comp.lang.c++
  5. Subject: TResourceFile Memory Los
  6. Message-ID: <726147569.0@ttlg.ttlg.UUCP>
  7. Date: 04 Jan 93  00:06:00 mst
  8. Lines: 32
  9.  
  10. Hi All, 
  11.  
  12. I am using Borland C++ 3.1 and Turbo Vision and am having a 
  13. memory loss of 32 bytes every time I instantiate a TResourceFile 
  14. and then destroy it. I have looked through the documentation and 
  15. my usage of this object is correct. Here is the Code: 
  16.  
  17.    ... 
  18.    fpstream *ifps; 
  19.  
  20.    ifps = new fpstream("FILE.NAM", ios::out | ios::binary); 
  21.    if (ifps->good()) 
  22.    { 
  23.      TResourceFile *res; 
  24.      res = new TResourceFile(ifps); 
  25.      destroy(res); 
  26.    } 
  27.    else delete(ifps); 
  28.    ... 
  29.  
  30. This code creates a TResourceFile and destroys it immediately. There 
  31. should be no loss of memory, but 32 bytes escape... Where is this 
  32. memory loss occuring? I am afraid that some kind of dangling pointer 
  33. will come back to haunt me and my clients! :) 
  34.  
  35. Thanks for any help you can give me. 
  36.  
  37. -Neal 
  38.  
  39. ... OFFLINE 1.41 
  40.  
  41.  * Origin: Paradigm BBS: A programmer's paradise. (42:100/11)
  42.