Permalink
Browse files

Make sure to initialize free_ before trying to setup rdata

  • Loading branch information...
dbussink committed Jan 8, 2013
1 parent b3cf685 commit 7e451f717ef7135ab55d2f548ee61982bde36d40
Showing with 2 additions and 2 deletions.
  1. +1 −1 vm/builtin/data.cpp
  2. +1 −1 vm/capi/data.cpp
View
@@ -20,6 +20,7 @@ namespace rubinius {
Data* data;
data = state->new_object<Data>(G(data));
+ data->freed_ = false;
// Data is just a heap alias for the handle, so go ahead and create
// the handle and populate it as an RData now.
@@ -39,7 +40,6 @@ namespace rubinius {
rdata->dfree = free;
data->internal_ = rdata;
- data->freed_ = false;
if(mark || free) {
state->memory()->needs_finalization(data, (FinalizerFunction)&Data::finalize);
View
@@ -15,7 +15,7 @@ namespace rubinius {
Data* data = as<Data>(object_);
if(data->freed_p()) {
- // rb_raise(rb_eArgError, "Data object has already been freed");
+ rb_raise(rb_eArgError, "Data object has already been freed");
}
if(type_ == cRData) {

0 comments on commit 7e451f7

Please sign in to comment.