Skip to content

Commit 491189f

Browse files
committed
Fix garbage deref with DisplayList property structures
This is the real fix to issue 6158892. We currently delete transform/camera structures at DisplayList destructor time, if these structures are not NULL. We set the fields to NULL in an init() method called (eventually) by the constructor. But it is possible for the object to be destroyed before that init code is called, resulting in the deref bug reported. The fi is to set these structures to NULL directly in the constructor. Issue 6158892i: Device runtime restarts frequently Change-Id: Ibfa0f9314767eed6fd51f4ec7edc0d0edd5fdd0f
1 parent 3c9d9c1 commit 491189f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libs/hwui/DisplayListRenderer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ void DisplayList::outputLogBuffer(int fd) {
9191
fflush(file);
9292
}
9393

94-
DisplayList::DisplayList(const DisplayListRenderer& recorder) {
94+
DisplayList::DisplayList(const DisplayListRenderer& recorder) :
95+
mTransformMatrix(NULL), mTransformCamera(NULL), mTransformMatrix3D(NULL) {
96+
9597
initFromDisplayListRenderer(recorder);
9698
}
9799

@@ -124,9 +126,6 @@ void DisplayList::initProperties() {
124126
mWidth = 0;
125127
mHeight = 0;
126128
mPivotExplicitlySet = false;
127-
mTransformMatrix = NULL;
128-
mTransformCamera = NULL;
129-
mTransformMatrix3D = NULL;
130129
mCaching = false;
131130
}
132131

0 commit comments

Comments
 (0)