diff options
| -rw-r--r-- | mrbgems/mruby-time/src/time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c index 3d806c140..74882e1e8 100644 --- a/mrbgems/mruby-time/src/time.c +++ b/mrbgems/mruby-time/src/time.c @@ -528,6 +528,8 @@ mrb_time_initialize(mrb_state *mrb, mrb_value self) if (tm) { mrb_time_free(mrb, tm); } + DATA_TYPE(self) = &mrb_time_type; + DATA_PTR(self) = NULL; n = mrb_get_args(mrb, "|iiiiiii", &ayear, &amonth, &aday, &ahour, &amin, &asec, &ausec); @@ -538,7 +540,6 @@ mrb_time_initialize(mrb_state *mrb, mrb_value self) tm = time_mktime(mrb, ayear, amonth, aday, ahour, amin, asec, ausec, MRB_TIMEZONE_LOCAL); } DATA_PTR(self) = tm; - DATA_TYPE(self) = &mrb_time_type; return self; } |
