summaryrefslogtreecommitdiff
path: root/data/patches/gnuzilla-bug-1055166.patch
blob: 51b8ee586a185c14f94f579d896fc270d5dc2d17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: James Willcox <snorp@snorp.net>
Bug 1055166 - Catch IllegalStateException when recycling Message



diff --git a/mobile/android/base/GeckoAppShell.java b/mobile/android/base/GeckoAppShell.java
index b06547f8c8135542d27713bb8e4c5d0e7496bb17..a50538e1b3449d3767ad78ed3fb8e596bc1acfbb 100644
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -2478,17 +2478,22 @@ public class GeckoAppShell
             // Our "queue is empty" message; see runGecko()
             msg.recycle();
             return false;
         }
         if (msg.getTarget() == null) 
             Looper.myLooper().quit();
         else
             msg.getTarget().dispatchMessage(msg);
-        msg.recycle();
+
+        try {
+            msg.recycle();
+        } catch (IllegalStateException e) {
+            // There is nothing we can do here so just eat it
+        }
         return true;
     }
 
     @WrapElementForJNI
     public static void notifyWakeLockChanged(String topic, String state) {
         if (getGeckoInterface() != null)
             getGeckoInterface().notifyWakeLockChanged(topic, state);
     }