From: Arno P. <ar...@pu...> - 2012-07-17 05:57:51
|
On 7/16/12 7:53 PM, JR Schmidt wrote: > I am curious how CGBitmapContextRefs generated by > CGBitmapContext.create() are handled, if at all. A similar issue arises > with CGImageRef created. CGBitmapContext is derived from CFType. The latter overrides finalize(). The somewhat funny thing is that the code in org_xmlvm_iphone_CFType_finalize_org_xmlvm_iphone_CFType__() is commented out. Not sure how that happened. :) > So I am wondering: > 1) Is "CG" resource management being done in the c implementation? If > so, how? Yes, via CFType.finalize(), except that the CFRelease() is commented out in the C backend (I have no idea why). > 2) If no resource management is being done, is there a way to release > them manually? I fear that this will require modifying the c > implementation, which looks extremely difficult. It should be handled via the finalizer (in the C backend). > 3) Alternatively, is it possible to mix-and-match the objective c and c > implementations of the XMLVM classes? Writing the objective c > implementations looks far more straightforward, but I still the c back > end for full java classlib compatibility. No. The ObjC backend relies on reference counting whereas the C backend comes with a proper GC. The two backends can't be mixed. Arno |