Re: Memory leak using NewAnsiString

From: Arnau Font (afont_at_nospam-ipssoft.com)
Date: 11/27/03


Date: Thu, 27 Nov 2003 13:08:11 +0100

So sorry!!! After looking a lot of places, I've seen that AQTime needs the
project to be compiled with the 'build with run-time packages' option
activated!!!

Only one memory leak remaining ;)

Thanks!

Sorry about all the mess! Thanks a lot for your comments!
"Arnau Font" <afont@nospam-ipssoft.com> wrote in message
news:3fc34bf4$1@newsgroups.borland.com...
> Hi,
>
> I've tested my application using one debugger, and the results are that
> there are some memory leaks, most of them involving the use of strings,
like
> in this case:
>
> var
> s: String;
> begin
> s:=ProcThatFillsTheStr(bla,bla);
> DoSomethingWithString(s);
> end;
>
> The debugger says that 's' generates a memory leak, but shouldn't it be
> freed automatically by the delphi compiler?
>
> What should I do? Pass the 's' string as a var parameter to the function?
> Call finalitze or SetLength(s,0) at the end of the procedure?
>
> Thnaks!
>
>



Relevant Pages

  • Re: Is C99 the final C? (some suggestions)
    ... > Microsoft compiler, or do you draw the line at C89? ... in the same sense that the implementors of the Lua language considered C to be ... Now why would they bother if portable mutex implementations ... C doesn't have strings. ...
    (comp.lang.c)
  • Re: Symbols, metacircular evaluation, external representation.
    ... You could only use strings, and you would have to use parsers all the time. ... same kind of symbolic expressions, it's very easy to write functions ... writting a metacircular interpreter (or a lisp compiler), ... lists. ...
    (comp.lang.scheme)
  • Re: Verbose functional languages?
    ... A lazy language might, in the end, not be what you need. ... if the compiler unboxes them for you by way of optimization. ... and strictness can be infered to a great extent. ... But strings were always a very slow and memory ...
    (comp.lang.functional)
  • Re: Internal Representation of Strings
    ... strings are likely to be very small, ... It just seems like low overhead strings always have a ... (No, I haven't built a compiler, yet). ... saving 1 or 2 bytes will not matter so much if the memory comes ...
    (comp.compilers)
  • Re: newbie question about string initialization
    ... This is almost certainly a variation in compiler "interpretation" of the ... standard, I'm not sure if it can be classified as a "bug" but certainly a ... functions that are "safe" versions that do a character by character check ... The design of F77 strings is extremely poor in a number of significant areas ...
    (comp.lang.fortran)