jeffrey-s-foster/rtc — Issue #16: Handle frozen objects.
Author: jtoman
Created: 2012-02-26 20:58:38+00:00
State: open

Currently Rtc caches type and meta information on an object. This means that the first time either the meta information or the type information is accessed, the object is written to. However, this will cause a problem is the object is frozen, as the following shows:

```ruby
a = {}
a.freeze
puts a.rtc_type #throws a RuntimeError
```
One solution would be to check if the object is frozen and then cache the information somewhere that is guaranteed to not be frozen (some object internal to Rtc for example). The only problem with this is that putting it in a global cache means that the type object would never be garbage collected. One possible to solution is add a finalizer for frozen objects that would clear the cache. Finalizers are pretty much the worst thing ever (tm) in Java apparently, but it'd be worth taking a look at this solution.