Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory leak #14127

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a78654c
fix memory leak
yk3372 May 23, 2017
694487b
Update Colors.md
May 23, 2017
2aa8eba
Update Accessibility.md
May 23, 2017
cc653fb
Add @format to a few files
cpojer May 23, 2017
3e6f86e
Properly mock `path` in DependencyGraph-test
cpojer May 23, 2017
35e1397
Minor lint fixes
cpojer May 23, 2017
cf24d4c
Add Prop type for View
mjmahone May 23, 2017
acbbfc3
packager: add missing dep
May 23, 2017
2f28373
Create an `OutputFn` that can build indexed RAM bundles
davidaurelio May 23, 2017
0cf80fd
Simplify `File` type: `map` is nullable, but not optional
davidaurelio May 23, 2017
cf7f33d
Covariant properties for `ModuleTransportLike`
davidaurelio May 23, 2017
5afb3ed
Use `ModuleTransportLike` only with `$ReadOnlyArray`
davidaurelio May 23, 2017
83c9fa2
Update Getting Started, Upgrading for CRNA
hramos May 23, 2017
730df65
Add viewIsDescendantOf for UIManager on Android
Swordsman-Inaction May 23, 2017
92fc282
Fixing potential measure call with negative size value
May 23, 2017
7c42b69
packager: ResolutionRequest: use _loadAsFile from _loadAsDir
May 23, 2017
a038f2f
packager: ResolutionRequest: refactor _loadAsDir and dependents
May 23, 2017
996bbe1
Expand Getting Started, Debugging, Running on Device guides.
hramos May 23, 2017
b1ae29b
Move packager launcher scripts outside of `packager/`
davidaurelio May 23, 2017
4334cfe
Fix DependencyGraph-test in OS.
cpojer May 23, 2017
75916c1
Reinstate RCTDeviceEventEmitter section for Android docs
May 23, 2017
aac33ce
ESLint: Upgrade to 3.19.0
yungsters May 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.queue.MessageQueueThread;
import com.facebook.react.bridge.queue.MessageQueueThreadRegistry;
import com.facebook.react.bridge.queue.QueueThreadExceptionHandler;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl;
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.uimanager.ViewManagerPropertyUpdater;
import com.facebook.soloader.SoLoader;
import com.facebook.systrace.Systrace;
import com.facebook.systrace.TraceListener;
Expand Down Expand Up @@ -297,6 +299,9 @@ public void run() {
}
});

MessageQueueThreadRegistry.clear();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What MessageQueueThread is associated with the UI thread? I don't think this does anything.

ViewManagerPropertyUpdater.clear();

// This is a noop if the listener was not yet registered.
Systrace.unregisterListener(mTraceListener);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ public static MessageQueueThread myMessageQueueThread() {
sMyMessageQueueThread.get(),
"This thread doesn't have a MessageQueueThread registered to it!");
}

public static void clear() {
sMyMessageQueueThread.remove();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public interface ShadowNodeSetter<T extends ReactShadowNode> extends Settable {
new HashMap<>();
private static final Map<Class<?>, ShadowNodeSetter<?>> SHADOW_NODE_SETTER_MAP = new HashMap<>();

public static void clear() {
ViewManagersPropertyCache.clear();
VIEW_MANAGER_SETTER_MAP.clear();
SHADOW_NODE_SETTER_MAP.clear();
}

public static <T extends ViewManager, V extends View> void updateProps(
T manager,
V v,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
private static final Map<Class, Map<String, PropSetter>> CLASS_PROPS_CACHE = new HashMap<>();
private static final Map<String, PropSetter> EMPTY_PROPS_MAP = new HashMap<>();

public static void clear() {
CLASS_PROPS_CACHE.clear();
EMPTY_PROPS_MAP.clear();
}

/*package*/ static abstract class PropSetter {

protected final String mPropName;
Expand Down