From: Panayotis K. <pan...@pa...> - 2010-11-23 00:12:26
|
I have a question, regarding memory issues and CGRect (and Obj-C backend). It seems that structs are a bit more complicated than usual. Let's consider the following Java code segment: CGRect myrect = new CGRect(0,0,0,0); // under Obj-C a CGPoint and CGSize will be allocated myrect.size = new CGSize(0,0); // under Obj-C a new CGSize will be applied to the myrect object, // but the "old" CGSize object is never deallocated if I did myrect.size = null; myrect.size = new CGSize(0,0); then the memory will be properly freed Any ideas how to get rid of this problem (apart from changing code writing style?) |