Revision: 2528
http://sourceforge.net/p/swingme/code/2528
Author: yuranet
Date: 2021-07-08 23:57:14 +0000 (Thu, 08 Jul 2021)
Log Message:
-----------
fix for EXC_BAD_ACCESS crash
Modified Paths:
--------------
iOSME/src/javax/microedition/lcdui/Graphics.java
iOSME/src/javax/microedition/lcdui/Image.java
Modified: iOSME/src/javax/microedition/lcdui/Graphics.java
===================================================================
--- iOSME/src/javax/microedition/lcdui/Graphics.java 2021-07-08 22:30:11 UTC (rev 2527)
+++ iOSME/src/javax/microedition/lcdui/Graphics.java 2021-07-08 23:57:14 UTC (rev 2528)
@@ -457,7 +457,7 @@
// may throw NullPointerException, this is ok
if (xSrc + width > src.getWidth() || ySrc + height > src.getHeight() || width < 0 || height < 0 || xSrc < 0 || ySrc < 0) {
- throw new IllegalArgumentException("Area out of Image: "+src.getWidth()+"x"+src.getHeight()+" area: "+xSrc+","+ySrc+" "+width+"x"+height);
+ throw new IllegalArgumentException("Area out of Image: " + src.getWidth() + "x" + src.getHeight() + " area: " + xSrc + "," + ySrc + " " + width + "x" + height + " " + src);
}
if (anchor == 0) {
Modified: iOSME/src/javax/microedition/lcdui/Image.java
===================================================================
--- iOSME/src/javax/microedition/lcdui/Image.java 2021-07-08 22:30:11 UTC (rev 2527)
+++ iOSME/src/javax/microedition/lcdui/Image.java 2021-07-08 23:57:14 UTC (rev 2528)
@@ -40,6 +40,7 @@
throw new NullPointerException();
}
this.context = context;
+ CoreGraphics.CGContextRetain(context);
}
public static Image createImage(String resource) throws IOException {
@@ -218,6 +219,8 @@
// load the current image into the context
UIKit.UIGraphicsBeginImageContext(new CGSize(getWidth(), getHeight()));
context = UIKit.UIGraphicsGetCurrentContext();
+ CoreGraphics.CGContextRetain(context);
+
uiImage.drawAtPoint(CoreGraphics.CGPointZero());
}
@@ -247,6 +250,7 @@
}
UIKit.UIGraphicsEndImageContext();
+ CoreGraphics.CGContextRelease(context);
context = null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|