Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Commit a5a2b3f

Browse files
committed
fixes for Ruby 1.9. The patch at http://redmine.ruby-lang.org/issues/5174
is needed.
1 parent 3348c11 commit a5a2b3f

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

mod_ruby.c

+13-6
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,6 @@ static void ruby_init_interpreter(server_rec *s)
658658
RETSIGTYPE (*sigterm_handler)_((int));
659659
#endif
660660
#ifdef RUBY_VM
661-
void Init_prelude(void);
662661
RUBY_INIT_STACK;
663662
#else
664663
VALUE stack_start;
@@ -704,7 +703,7 @@ static void ruby_init_interpreter(server_rec *s)
704703

705704
ruby_init_loadpath();
706705
#ifdef RUBY_VM
707-
Init_prelude();
706+
ruby_init_prelude();
708707
#endif
709708
default_load_path = rb_ary_dup(GET_LOAD_PATH());
710709
rb_global_variable(&default_load_path);
@@ -734,6 +733,7 @@ static void ruby_init_interpreter(server_rec *s)
734733
}
735734
}
736735

736+
#ifndef RUBY_VM
737737
static void dso_unload(void *handle)
738738
{
739739
#if defined(_WIN32)
@@ -747,16 +747,24 @@ static void dso_unload(void *handle)
747747
#endif
748748
}
749749

750-
static void ruby_finalize_interpreter()
750+
static void ruby_unload_libraries()
751751
{
752752
RUBY_EXTERN VALUE ruby_dln_librefs;
753753
int i;
754754

755-
ruby_finalize();
756755
for (i = 0; i < RARRAY_LEN(ruby_dln_librefs); i++) {
757756
dso_unload((void *) NUM2LONG(RARRAY_PTR(ruby_dln_librefs)[i]));
758757
}
759758
}
759+
#endif
760+
761+
static void ruby_finalize_interpreter()
762+
{
763+
ruby_finalize();
764+
#ifndef RUBY_VM
765+
ruby_unload_libraries();
766+
#endif
767+
}
760768

761769
#if APR_HAS_THREADS
762770
static void* APR_THREAD_FUNC ruby_thread_start(apr_thread_t *t, void *data)
@@ -1006,8 +1014,7 @@ void rb_setup_cgi_env(request_rec *r)
10061014

10071015
static VALUE kill_threads(VALUE arg)
10081016
{
1009-
extern VALUE rb_thread_list();
1010-
VALUE threads = rb_thread_list();
1017+
VALUE threads = rb_protect_funcall(rb_cThread, rb_intern("list"), NULL, 0);
10111018
VALUE main_thread = rb_thread_main();
10121019
VALUE th;
10131020
int i;

mod_ruby.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ void rb_thread_start_timer_thread(void);
4747

4848
#define IO_PATH(fptr) (StringValuePtr(fptr->pathv))
4949

50-
VALUE rb_get_load_path(void);
51-
#define GET_LOAD_PATH() (rb_get_load_path())
50+
#define GET_LOAD_PATH() (rb_gv_get("$:"))
5251
#define SET_LOAD_PATH(path) (rb_gv_set("$:", path))
5352

5453
#else

0 commit comments

Comments
 (0)