[前][次][番号順一覧][スレッド一覧]

ruby-changes:14612

From: wyhaines <ko1@a...>
Date: Thu, 28 Jan 2010 04:05:48 +0900 (JST)
Subject: [ruby-changes:14612] Ruby:r26457 (ruby_1_8_6): Backport #2009 ; (rb_io_fptr_finalize): free fptr to avoid memory leaks.

wyhaines	2010-01-28 04:01:31 +0900 (Thu, 28 Jan 2010)

  New Revision: 26457

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26457

  Log:
    Backport #2009 [ruby-core:25173]; (rb_io_fptr_finalize): free fptr to avoid memory leaks.
    My brain got stuck in a bad pattern, and I kept adding new items under the first record for the day. They are all broken out into their own entries like they should be, now, with timestamps pulled from the SVN log.

  Modified files:
    branches/ruby_1_8_6/ChangeLog
    branches/ruby_1_8_6/io.c

Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog	(revision 26456)
+++ ruby_1_8_6/ChangeLog	(revision 26457)
@@ -1,12 +1,25 @@
-Wed Jan 27 22:16:00 2010 Kirk Haines <khaines@r...>
+Wed Jan 28 04:00:00 2010 Kirk Haines <khaines@r...>
 
-	* io.c: Backport #1916 [ruby-core:24838]; (rb_sysopen): workaround for MSVCRT's bug.
+	* io.c: Backport #2009 [ruby-core:25173]; (rb_io_fptr_finalize): free fptr to avoid memory leaks.
 
+	* ChangeLog: My brain got stuck in a bad pattern, and I kept adding new items under the first record for the day. They are all broken out into their own entries like they should be, now, with timestamps pulled from the SVN log.
+
+Thu Jan 28 03:18:10 2010 Kirk Haines <khaines@r...>
+
+	* io.c: Backport #1916 [ruby-core:24838]; (rb_sysopen): workaround for MSVCRT's bug. r26455
+
+Wed Jan 27 23:58:36 2010 Kirk Haines <khaines@r...>
+
 	* re.h: Backport #1875 [ruby-core:24735]; (RMATCH_REGS): added for compatibility. r26452
 	  ruby.h: (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*): backported macros for compatiblity from trunk. r26452
 
+
+Wed Jan 27 23:36:38 2010 Kirk Haines <khaines@r...>
+
 	* io.c: Backport #1818 [ruby-core:24561]; (argf_eof): go to the next file if called after ARGF.close or ARGF.skip. r26451
 
+Wed Jan 27 22:16:00 2010 Kirk Haines <khaines@r...>
+
 	* lib/rexml/text.rb: Backport #1806 [ruby-core:24506]; (REXML::Text.normalize): call to_s for input. r26442
 
 Tue Jan 26 3:03:00 2010 Kirk Haines <khaines@r...>
Index: ruby_1_8_6/io.c
===================================================================
--- ruby_1_8_6/io.c	(revision 26456)
+++ ruby_1_8_6/io.c	(revision 26457)
@@ -2230,10 +2230,10 @@
     if (fptr->path) {
 	free(fptr->path);
     }
-    if (!fptr->f && !fptr->f2) return;
-    if (fileno(fptr->f) < 3) return;
-
-    rb_io_fptr_cleanup(fptr, Qtrue);
+    if ((fptr->f && fileno(fptr->f) > 2) || fptr->f2) {
+	rb_io_fptr_cleanup(fptr, Qtrue);
+    }
+    xfree(fptr);
 }
 
 VALUE

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]