瀏覽代碼

Closing the app might lead to a crash due to an IllegalArgumentException

Xavier Sellier 7 年之前
父節點
當前提交
b6a2d5f508
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java

+ 7 - 1
platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java

@@ -193,7 +193,13 @@ public class PaymentsManager {
 
 	public void destroy() {
 		if (mService != null) {
-			activity.unbindService(mServiceConn);
+			try {
+				activity.unbindService(mServiceConn);
+			} catch (IllegalArgumentException e) {
+				// Somehow we've already been unbound. This is a non-fatal
+				// error.
+				Log.e(TAG, "Unable to unbind from payment service (already unbound)");
+			}
 		}
 
 		mSetupDone = false;