octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leak with octave cygwin DLD calls


From: John W. Eaton
Subject: Re: Memory leak with octave cygwin DLD calls
Date: Wed, 27 Apr 2005 01:06:43 -0400

On 26-Apr-2005, Dmitri A. Sergatskov <address@hidden> wrote:

| Memory leaks are tough to debug. We have this "MacKay leak"[*] for a while,
| and no valgrind can help much so far ... :(
| 
| [*]  http://www.octave.org/octave-lists/archive/bug-octave.2004/msg00352.html

For this problem, does the following patch help?  It seems to solve
the problem for me (which I am now able to reproduce).

jwe


src/ChangeLog:

2005-04-27  John W. Eaton  <address@hidden>

        * parse.y: (safe_fclose): Delete comment list to avoid memory leak.


Index: src/parse.y
===================================================================
RCS file: /cvs/octave/src/parse.y,v
retrieving revision 1.234
diff -u -r1.234 parse.y
--- src/parse.y 26 Apr 2005 19:24:33 -0000      1.234
+++ src/parse.y 27 Apr 2005 05:01:08 -0000
@@ -2919,7 +2919,9 @@
   // statement, possibly from the command line or another file, which
   // can be quite confusing).
 
-  octave_comment_buffer::get_comment ();
+  octave_comment_list *tc = octave_comment_buffer::get_comment ();
+
+  delete tc;
 
   if (f)
     fclose (static_cast<FILE *> (f));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]