Automatically init native memory when allocating java wrapper

Reviewed By: lucasr

Differential Revision: D3992802

fbshipit-source-id: 06d65821f1802ed8f2b2db651cef69f6851803f2
This commit is contained in:
Emil Sjolander 2016-10-12 03:44:52 -07:00 committed by Facebook Github Bot
parent 6dae68306e
commit 38bd937b40
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
private long mNativePointer;
private Object mData;
public CSSNode() {
init();
}
private void assertNativeInstance() {
if (mNativePointer == 0) {
throw new IllegalStateException("Null native pointer");