[tor-commits] [orbot/master] don't manually call onDestroy, just call finish()

n8fr8 at torproject.org n8fr8 at torproject.org
Sun Sep 7 13:42:55 UTC 2014


commit a0b32ba068c82525d6984ba6cd5e44a1333dd9cf
Author: Nathan Freitas <nathan at freitas.net>
Date:   Fri Aug 29 00:16:31 2014 -0400

    don't manually call onDestroy, just call finish()
---
 src/org/torproject/android/Orbot.java |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java
index 87276ef..209896d 100644
--- a/src/org/torproject/android/Orbot.java
+++ b/src/org/torproject/android/Orbot.java
@@ -432,7 +432,8 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
                         //terminology but also making sure there are clear distinctions in control
                         stopTor();
                         
-                        onDestroy();
+                        //onDestroy();
+                        
                         
                 } catch (RemoteException e) {
                         Log.w(TAG, e);
@@ -448,11 +449,17 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
 	 * @see android.app.Activity#onPause()
 	 */
 	protected void onPause() {
-		super.onPause();
-
-		if (aDialog != null)
-			aDialog.dismiss();
-		
+		try
+		{
+			super.onPause();
+	
+			if (aDialog != null)
+				aDialog.dismiss();
+		}
+		catch (IllegalStateException ise)
+		{
+			//can happen on exit/shutdown
+		}
 	}
 	
 	private void doTorCheck ()





More information about the tor-commits mailing list