DO NOT MERGE Fix finalizer ordering/double-free issue
Bug: 18289984
If Surface:finalize() happens after HwuiContext:finalize()
it would try to manipulate a destroyed object. However, as
Surface:finalize() always calls HwuiContext:destroy() this
can be fixed by simply getting rid of HwuiContext's finalizer
Change-Id: I7c912214417ab32891b1c58d045c9721e5f01965
(cherry picked from commit c298f9c917)
This commit is contained in:
@@ -601,15 +601,6 @@ public class Surface implements Parcelable {
|
|||||||
mHwuiRenderer = 0;
|
mHwuiRenderer = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void finalize() throws Throwable {
|
|
||||||
try {
|
|
||||||
destroy();
|
|
||||||
} finally {
|
|
||||||
super.finalize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static native long nHwuiCreate(long rootNode, long surface);
|
private static native long nHwuiCreate(long rootNode, long surface);
|
||||||
|
|||||||
Reference in New Issue
Block a user