From: Panayotis K. <pan...@pa...> - 2012-02-24 13:32:13
|
Is it possible to give me some hints, how the GC is working with inner classes? I have this scenario: A class (level 0) has an anonymous inner class (level 1) , which in turn has inside another anonymous inner class (level 2). The lifetime is like this: i) Class of level 0, creates a level 1 class ii) Level 1 class creates level 2 class and gives its reference back to level 0 class iii Level 0 class removes all usage & references of level 1 class (the item should be released) iv) Level 2 class starts executing, while requiring some variables of level 0 class. If I am correct, currently XMLVM is able to access information of level 0 class to the level 2 class through the level 1 class. If this is so, a segmentation fault would appear. 1) Is this situation handled correctly by the C backend? 2) In ObjC backend, I can see that the inner classes hold a weak reference to the parent class. What if we establish a strong reference between the parent and the inner class ? |