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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
=?utf-8?q?Fr=C3=A9d=C3=A9ric_COIFFIER?= (Guest)
on 2005-12-14 19: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
engine (to evaluate a script) [only in this thread which is created on

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

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

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