From dbf146f1d69be31d12fc1c16b71beb9f4f2fb2a8 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 6 Mar 2013 17:51:15 -0800 Subject: [PATCH 1/2] Fix RefBase debugging. O_CREAT must specify the mode. Change-Id: I51c6df3cfd59b20ca73c3edee86bc2f74dbde1b1 --- libs/utils/RefBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp index e80a795b7..2b39bce2e 100644 --- a/libs/utils/RefBase.cpp +++ b/libs/utils/RefBase.cpp @@ -199,7 +199,7 @@ public: { char name[100]; snprintf(name, 100, "/data/%p.stack", this); - int rc = open(name, O_RDWR | O_CREAT | O_APPEND); + int rc = open(name, O_RDWR | O_CREAT | O_APPEND, 644); if (rc >= 0) { write(rc, text.string(), text.length()); close(rc); From e041716ba17674b9af957f68750ad6b2df376c22 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 6 Mar 2013 18:50:52 -0800 Subject: [PATCH 2/2] Make GraphicBuffer a RefBase - this gives us access to RefBase's refcounting debugging - it doesn't cost much because GraphicBuffer already has a vtable Change-Id: I7f696e421fea14b14bfaeb83880689b83e96af4d --- include/ui/GraphicBuffer.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index 4b9b5a833..ea9368d85 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -24,6 +24,7 @@ #include #include #include +#include struct ANativeWindowBuffer; @@ -37,10 +38,8 @@ class GraphicBufferMapper; // =========================================================================== class GraphicBuffer - : public ANativeObjectBase< - ANativeWindowBuffer, - GraphicBuffer, - LightRefBase >, public Flattenable + : public ANativeObjectBase< ANativeWindowBuffer, GraphicBuffer, RefBase >, + public Flattenable { public: