Patches for crash possibility points
MODIFY
src/android/plugin/google/maps/MyPluginLayout.java
src/android/plugin/google/maps/MyPluginLayout.java
@@ -81,6 +81,9 @@ public class MyPluginLayout extends FrameLayout implements ViewTreeObserver.OnSc
RectF drawRect;
for (int i = 0; i < mapIds.length; i++) {
mapId = mapIds[i];
+ if (mapId == null) {
+ continue;
+ }
pluginOverlay = pluginOverlays.get(mapId);
if (pluginOverlay == null || pluginOverlay.getDivId() == null) {
continue;

MODIFY
src/android/plugin/google/maps/PluginMarker.java
src/android/plugin/google/maps/PluginMarker.java
@@ -118,6 +118,7 @@ public class PluginMarker extends MyPlugin implements MyPluginInterface {
// Recycle bitmaps as much as possible
//--------------------------------------
if (iconCacheKeys != null) {
+ if (iconCacheKeys.size() > 0) {
String[] cacheKeys = iconCacheKeys.keySet().toArray(new String[iconCacheKeys.size()]);
for (int i = 0; i < cacheKeys.length; i++) {
AsyncLoadImage.removeBitmapFromMemCahce(cacheKeys[i]);
@@ -125,7 +126,8 @@ public class PluginMarker extends MyPlugin implements MyPluginInterface {
}
cacheKeys = null;
}
- if (icons != null) {
+ }
+ if (icons != null && icons.size() > 0) {
String[] keys = icons.keySet().toArray(new String[icons.size()]);
//Bitmap[] cachedBitmaps = icons.toArray(new Bitmap[icons.size()]);
Bitmap image;
@@ -146,6 +148,7 @@ public class PluginMarker extends MyPlugin implements MyPluginInterface {
@Override
public void run() {
Set<String> keySet = pluginMap.objects.keys;
+ if (keySet.size() > 0) {
String[] objectIdArray = keySet.toArray(new String[keySet.size()]);
for (String objectId : objectIdArray) {
@@ -169,6 +172,7 @@ public class PluginMarker extends MyPlugin implements MyPluginInterface {
_clearDone = true;
semaphoreAsync.notify();
}
+ }
}
});

Patches for crash possibility points #2569