Fixed: CPImage -size returned internal object ref

Previously, CPImage -size returned a reference to the internal _size object, which allowed the caller to directly change _size. In Cocoa a copy of the size is returned.

This commit returns a copy of _size to ensure no unwanted side effects.
This commit is contained in:
Aparajita Fishman
2015-10-16 16:20:24 -04:00
parent ce8f8c05e1
commit 526181a76b
+1 -1
View File
@@ -275,7 +275,7 @@ function CPAppKitImage(aFilename, aSize)
*/
- (CGSize)size
{
return _size;
return CGSizeMakeCopy(_size);
}
+ (id)imageNamed:(CPString)aName