🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11824

Re: std::string to BSTR conversion function leaks memory... (Urgent please)

#11824
From: Fernando
Date: Fri, 16 Jan 2004 17:29
22 lines
2010 bytes
On Fri, 16 Jan 2004 11:33:21 -0500, "Ed Mulroy [TeamB]"
<dont_email_me@bitbuc.ket> wrote:

>I do not know that Visual Basic handles it automatically.

VB does have a primitive (reference count) garbage collector.

>  It all depends
>upon the code the writer of the VB part used.

That's me. :-) I just call the function and save the result in a VB string
(BSTR).
>You said that CodeGuard did not find any leaks yet there is a memory leak.
>How do you determine that there is a memory leak?

Well... actually CodeGuard doesn complain if I call that function from with a
test exe (within the BCB ide). However, if I create a dll (with code guard
enabled) and call it from VB, then I do get a messagebox from CodeGuard
complaining about a memory leak. :-?

If I run the VB code that call that function in the dll in a loop, memory
usage goes up pretty quickly.
Technical Details
Message-ID: <2j7g0012sja7vhngl777130qbb0sp4163k@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.algonet.se!algonet!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <bjlf005pg85nvabmpc7ksd5ugs624tua53@4ax.com> <4008039f$1@newsgroups.borland.com> <u11g001tat37jadh02pfhdvqk99lf85p0s@4ax.com> <40081253$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,61db49fd5c05f5b0
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-16 09:40:40 PST
From: Fernando  <frr@easyjob.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: std::string to BSTR conversion function leaks memory... (Urgent please)
Date: Fri, 16 Jan 2004 18:29:00 +0100
Message-ID: <2j7g0012sja7vhngl777130qbb0sp4163k@4ax.com>
References: <bjlf005pg85nvabmpc7ksd5ugs624tua53@4ax.com> <4008039f$1@newsgroups.borland.com> <u11g001tat37jadh02pfhdvqk99lf85p0s@4ax.com> <40081253$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.9/32.560
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 217.127.66.80
X-Trace: newsgroups.borland.com 1074274144 217.127.66.80 (16 Jan 2004 09:29:04 -0700)
Lines: 22
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.algonet.se!algonet!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail