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

ruby-changes:14041

From: shyouhei <ko1@a...>
Date: Thu, 19 Nov 2009 15:51:33 +0900 (JST)
Subject: [ruby-changes:14041] Ruby:r25852 (ruby_1_8_7): merge revision(s) 25181:

shyouhei	2009-11-19 15:51:19 +0900 (Thu, 19 Nov 2009)

  New Revision: 25852

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

  Log:
    merge revision(s) 25181:
    * io.c (rb_io_fptr_finalize): free fptr to avoid memory leaks.
      fixed: #2009   [ruby-core:25173] [ruby-dev:39410]

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/io.c
    branches/ruby_1_8_7/version.h

Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 25851)
+++ ruby_1_8_7/ChangeLog	(revision 25852)
@@ -1,3 +1,8 @@
+Thu Nov 19 15:34:40 2009  Yukihiro Matsumoto  <matz@r...>
+
+	* io.c (rb_io_fptr_finalize): free fptr to avoid memory leaks.
+	  fixed: #2009   [ruby-core:25173] [ruby-dev:39410]
+
 Thu Nov 19 15:27:17 2009  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* lib/net/http.rb (transport_request): Handle timeout error by
Index: ruby_1_8_7/version.h
===================================================================
--- ruby_1_8_7/version.h	(revision 25851)
+++ ruby_1_8_7/version.h	(revision 25852)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2009-11-19"
 #define RUBY_VERSION_CODE 187
 #define RUBY_RELEASE_CODE 20091119
-#define RUBY_PATCHLEVEL 213
+#define RUBY_PATCHLEVEL 214
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_7/io.c
===================================================================
--- ruby_1_8_7/io.c	(revision 25851)
+++ ruby_1_8_7/io.c	(revision 25852)
@@ -2334,10 +2334,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/

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