From 526181a76b3e28775dea24c917aa16b6e929128b Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Fri, 16 Oct 2015 16:20:24 -0400 Subject: [PATCH] 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. --- AppKit/CPImage.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPImage.j b/AppKit/CPImage.j index 674bb1d04..e735673a4 100644 --- a/AppKit/CPImage.j +++ b/AppKit/CPImage.j @@ -275,7 +275,7 @@ function CPAppKitImage(aFilename, aSize) */ - (CGSize)size { - return _size; + return CGSizeMakeCopy(_size); } + (id)imageNamed:(CPString)aName