Skip to content

Commit

Permalink
Fix arguemts passed to application
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchas116 committed May 16, 2015
1 parent f619b90 commit 391dce4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ext/qml/qml.c
Expand Up @@ -19,7 +19,13 @@ static VALUE qml_init(VALUE module, VALUE args) {
if (!NIL_P(rbqml_application)) {
rb_raise(rb_eRuntimeError, "QML already initialized");
}
rbqml_application = rb_funcall(rbqml_cApplication, rb_intern("new"), 1, args);

if (NIL_P(args)) {
args = rb_ary_new();
}
VALUE argv = rb_funcall(rb_get_argv(), rb_intern("+"), 1, args);

rbqml_application = rb_funcall(rbqml_cApplication, rb_intern("new"), 1, argv);
rbqml_engine = rb_funcall(rbqml_cEngine, rb_intern("new"), 0);
return module;
}
Expand Down

0 comments on commit 391dce4

Please sign in to comment.