Forum: Ruby Embed ruby in a threaded C++ Application (Mingw)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
34125f7eb60dbfc096be61de37de1fa2?d=identicon&s=25 =?utf-8?q?Fr=C3=A9d=C3=A9ric_COIFFIER?= (Guest)
on 2005-12-14 18:58
(Received via mailing list)
I'll try to explain the current status of my application :

I have a Qt4 Application which runs on Windows (thanks to Mingw).
In one thread created by this application, I would like to use the Ruby
1.8.2
engine (to evaluate a script) [only in this thread which is created on
the
fly].

So, I create a thread which makes the following thinks :

- ruby_init
- rb_eval_string(my script) [encapsulated in a rb_protect mechanism]
- some rb_funcalls [encapsulated in a rb_protect mechanism]
- ruby_finalize

And the thread is finished (and destoyed).

So, the first time I run my thread, all is perfect.
But, the second time, a segmentation fault occurs in the rb_eval_string
function. So, I suppose something wasn't correctly cleaned by
ruby_finalize...

Is there another way to finalize the Ruby engine ? Is something missing
?

Thank you
This topic is locked and can not be replied to.