Hi folks. I am trying to do something and I found a VM crash. Suppose I want to swap out a class, do a become with a proxy (that with the DNU will load the class back). In addition, I have instances of the swapped class.<br>
<br>Example of code (will crash in the last line):<br><br>o := MyObject new.<br>o foo: 123.<br>p := ClassProxy new.<br>p become: MyObject.<br>o == nil.<br>o foo.<br><br><br>My Object just extends Object, has an instVar 'foo', and implements the accessors. <br>
<br>ClassProxy implements:<br><br>become: aClass<br> className := aClass name.<br> aClass fileOut.<br> super become: aClass<br><br>and<br><br>doesNotUnderstand: aMessage<br> | reloadedClass |<br> (FileStream fileNamed: className, '.st') fileIn.<br>
reloadedClass := Smalltalk at: className. <br> self becomeForward: reloadedClass.<br> ^aMessage sendTo: reloadedClass<br><br><br>So....does someone know why the crash?<br><br>how can I solve it ?<br><br>Thanks in advance<br>
<br>Mariano<br>