[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit a0b32ba068c82525d6984ba6cd5e44a1333dd9cf
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
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 ()



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits