[macruby-changes] [1587] MacRuby/branches/experimental/roxor.cpp

source_changes at macosforge.org source_changes at macosforge.org
Fri May 22 05:18:50 PDT 2009


Revision: 1587
          http://trac.macosforge.org/projects/ruby/changeset/1587
Author:   vincent.isambart at gmail.com
Date:     2009-05-22 05:18:50 -0700 (Fri, 22 May 2009)
Log Message:
-----------
fixed the use of weak refs

Modified Paths:
--------------
    MacRuby/branches/experimental/roxor.cpp

Modified: MacRuby/branches/experimental/roxor.cpp
===================================================================
--- MacRuby/branches/experimental/roxor.cpp	2009-05-22 01:13:44 UTC (rev 1586)
+++ MacRuby/branches/experimental/roxor.cpp	2009-05-22 12:18:50 UTC (rev 1587)
@@ -8537,6 +8537,10 @@
     if ((iter == GET_VM()->blocks.end())
 	|| (iter->second->flags & (VM_BLOCK_ACTIVE | VM_BLOCK_PROC))) {
 
+	if (iter != GET_VM()->blocks.end()) {
+	    rb_objc_release(iter->second);
+	}
+
 	b = (rb_vm_block_t *)xmalloc(sizeof(rb_vm_block_t)
 		+ (sizeof(VALUE *) * dvars_size));
 
@@ -8693,6 +8697,8 @@
 			}
 		    }
 		}
+		// indicate to the GC that we do not have a reference here anymore
+		rb_gc_assign_weak_ref(NULL, &current->uses[use_index]);
 	    }
 	}
 	void *old_current = current;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090522/85c2a5f1/attachment-0001.html>


More information about the macruby-changes mailing list