mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
win32ole_event.c: use rb_write_error_str
* ext/win32ole/win32ole_event.c (rescue_callback): use rb_write_error_str instead of rb_write_error, to respect the encoding and prevent the message from GC. * internal.h (rb_write_error_str): export. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bf5d6f0723
commit
9c8d9f31f7
3 changed files with 12 additions and 2 deletions
|
|
@ -6,6 +6,8 @@
|
|||
* <code>WIN32OLE_EVENT</code> objects controls OLE event.
|
||||
*/
|
||||
|
||||
RUBY_EXTERN void rb_write_error_str(VALUE mesg);
|
||||
|
||||
typedef struct {
|
||||
struct IEventSinkVtbl * lpVtbl;
|
||||
} IEventSink, *PEVENTSINK;
|
||||
|
|
@ -468,7 +470,7 @@ rescue_callback(VALUE arg)
|
|||
VALUE msg = rb_funcall(e, rb_intern("message"), 0);
|
||||
bt = rb_ary_entry(bt, 0);
|
||||
error = rb_sprintf("%"PRIsVALUE": %"PRIsVALUE" (%s)\n", bt, msg, rb_obj_classname(e));
|
||||
rb_write_error(StringValuePtr(error));
|
||||
rb_write_error_str(error);
|
||||
rb_backtrace();
|
||||
ruby_finalize();
|
||||
exit(-1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue