home *** CD-ROM | disk | FTP | other *** search
- From: Neal.Sanche@ttlg.UUCP (Neal Sanche)
- Sender: postmaster@ttlg.UUCP
- 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
- Newsgroups: comp.lang.c++
- Subject: TResourceFile Memory Los
- Message-ID: <726147569.0@ttlg.ttlg.UUCP>
- Date: 04 Jan 93 00:06:00 mst
- Lines: 32
-
- Hi All,
-
- I am using Borland C++ 3.1 and Turbo Vision and am having a
- memory loss of 32 bytes every time I instantiate a TResourceFile
- and then destroy it. I have looked through the documentation and
- my usage of this object is correct. Here is the Code:
-
- ...
- fpstream *ifps;
-
- ifps = new fpstream("FILE.NAM", ios::out | ios::binary);
- if (ifps->good())
- {
- TResourceFile *res;
- res = new TResourceFile(ifps);
- destroy(res);
- }
- else delete(ifps);
- ...
-
- This code creates a TResourceFile and destroys it immediately. There
- should be no loss of memory, but 32 bytes escape... Where is this
- memory loss occuring? I am afraid that some kind of dangling pointer
- will come back to haunt me and my clients! :)
-
- Thanks for any help you can give me.
-
- -Neal
-
- ... OFFLINE 1.41
-
- * Origin: Paradigm BBS: A programmer's paradise. (42:100/11)
-