Clear static arg arrays after use

Reviewed By: astreet

Differential Revision: D2690812

fb-gh-sync-id: b00291c57e294eece5772531e9f16e0c60b8b8f4
This commit is contained in:
Alexander Blom 2015-11-24 09:47:39 -08:00 committed by facebook-github-bot-7
parent 69c8dd50fe
commit 2b22d22a83
1 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,7 @@ package com.facebook.react.uimanager;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -72,11 +73,13 @@ import com.facebook.react.bridge.ReadableMap;
VIEW_MGR_ARGS[0] = viewToUpdate; VIEW_MGR_ARGS[0] = viewToUpdate;
VIEW_MGR_ARGS[1] = extractProperty(props); VIEW_MGR_ARGS[1] = extractProperty(props);
mSetter.invoke(viewManager, VIEW_MGR_ARGS); mSetter.invoke(viewManager, VIEW_MGR_ARGS);
Arrays.fill(VIEW_MGR_ARGS, null);
} else { } else {
VIEW_MGR_GROUP_ARGS[0] = viewToUpdate; VIEW_MGR_GROUP_ARGS[0] = viewToUpdate;
VIEW_MGR_GROUP_ARGS[1] = mIndex; VIEW_MGR_GROUP_ARGS[1] = mIndex;
VIEW_MGR_GROUP_ARGS[2] = extractProperty(props); VIEW_MGR_GROUP_ARGS[2] = extractProperty(props);
mSetter.invoke(viewManager, VIEW_MGR_GROUP_ARGS); mSetter.invoke(viewManager, VIEW_MGR_GROUP_ARGS);
Arrays.fill(VIEW_MGR_GROUP_ARGS, null);
} }
} catch (Throwable t) { } catch (Throwable t) {
FLog.e(ViewManager.class, "Error while updating prop " + mPropName, t); FLog.e(ViewManager.class, "Error while updating prop " + mPropName, t);
@ -92,10 +95,12 @@ import com.facebook.react.bridge.ReadableMap;
if (mIndex == null) { if (mIndex == null) {
SHADOW_ARGS[0] = extractProperty(props); SHADOW_ARGS[0] = extractProperty(props);
mSetter.invoke(nodeToUpdate, SHADOW_ARGS); mSetter.invoke(nodeToUpdate, SHADOW_ARGS);
Arrays.fill(SHADOW_ARGS, null);
} else { } else {
SHADOW_GROUP_ARGS[0] = mIndex; SHADOW_GROUP_ARGS[0] = mIndex;
SHADOW_GROUP_ARGS[1] = extractProperty(props); SHADOW_GROUP_ARGS[1] = extractProperty(props);
mSetter.invoke(nodeToUpdate, SHADOW_GROUP_ARGS); mSetter.invoke(nodeToUpdate, SHADOW_GROUP_ARGS);
Arrays.fill(SHADOW_GROUP_ARGS, null);
} }
} catch (Throwable t) { } catch (Throwable t) {
FLog.e(ViewManager.class, "Error while updating prop " + mPropName, t); FLog.e(ViewManager.class, "Error while updating prop " + mPropName, t);