This is the mail archive of the
mailing list for the Cygwin project.
Re: Memory Leak - DLL problem
- From: Tirth Sanyal <tsanyal at yahoo dot com>
- To: cygwin at cygwin dot com
- Cc: Danny Smith <dannysmith at users dot sourceforge dot net>, dwsharp at iee dot org
- Date: Tue, 17 Sep 2002 12:21:11 -0700 (PDT)
- Subject: Re: Memory Leak - DLL problem
I tried allocating and deallocating on the same heap
i.e. the heap belonging to the DLL. However, the
problem still persists. Looks like there might be some
I have uploaded the modified version of the programs
as a tarball with a README file for installing and
running the program should you decide to try it out
yourself. Here is the url:
Would appreciate any more ideas.
--- Danny Smith <firstname.lastname@example.org> wrote:
> Don Sharp - Re: Memory Leak - DLL problemRe: Memory
> Leak - DLL problem
> From: Don Sharp <dwsharp at iee dot org>
> To: gnuwin32 <cygwin at cygwin dot com>
> Date: Sat, 14 Sep 2002 21:13:56 +0100
> Subject: Re: Memory Leak - DLL problem
> Tirth Sanyal wrote:
> > Hi,
> > I have been encountering a strange memory leak
> > in my code which has prompted me to write a small
> > program to isolate and demonstrate it. I have
> > the code at the bottom of the email.
> > - In a DLL say libfoo, I define and export a class
> > Base and also export a function "foo" whose
> > is the following:
> > Base* foo(void)
> > - "foo" instantiates an object of the class Base
> > returns a pointer to this object.
> > - In my application (which has the main routine) I
> > load the dynamic library libfoo, call function
> > in it , get the pointer to the newly created
> > and immediately call "delete" on this pointer.
> > - The destructor function of the class Base
> > in the libfoo DLL is called.
> There is an article called 'DLL Maintenance Made
> Easy' by Geoff
> Vandegrift . It used to be at
> www.devx.com/free/mgznarch/vcdj but best to do a
> Google search.
> It explains, among other things, how to "wrap"
> memory allocations and
> de-allocations so that you don't get leakage problem
> from allocating
> memory on one heap and de-allocating in another.
Do you Yahoo!?
Yahoo! News - Today's headlines
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html