diff options
| author | 2010-05-14 15:14:04 -0700 | |
|---|---|---|
| committer | 2010-05-14 15:14:04 -0700 | |
| commit | a8e0f75b7fe99dd6672bfc958734f4558905c3aa (patch) | |
| tree | 220d07ff6bd81691db9f8089e2f44c520845d9b5 | |
| parent | b73179c7c01edc21876777d95b7a08692d48e11c (diff) | |
| parent | 7450c02a35d7c1f8580f906d6f1c1a11bc5c4fd0 (diff) | |
am 7450c02a: am 900b6157: merge from open-source master
| -rw-r--r-- | libs/surfaceflinger_client/SurfaceComposerClient.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/surfaceflinger_client/SurfaceComposerClient.cpp b/libs/surfaceflinger_client/SurfaceComposerClient.cpp index 3117495d3f41..85167da17c6c 100644 --- a/libs/surfaceflinger_client/SurfaceComposerClient.cpp +++ b/libs/surfaceflinger_client/SurfaceComposerClient.cpp @@ -58,7 +58,7 @@ namespace android { // Must not be holding SurfaceComposerClient::mLock when acquiring gLock here. static Mutex gLock; static sp<ISurfaceComposer> gSurfaceManager; -static DefaultKeyedVector< sp<IBinder>, sp<SurfaceComposerClient> > gActiveConnections; +static DefaultKeyedVector< sp<IBinder>, wp<SurfaceComposerClient> > gActiveConnections; static SortedVector<sp<SurfaceComposerClient> > gOpenTransactions; static sp<IMemoryHeap> gServerCblkMemory; static volatile surface_flinger_cblk_t* gServerCblk; @@ -195,7 +195,7 @@ SurfaceComposerClient::clientForConnection(const sp<IBinder>& conn) { // scope for lock Mutex::Autolock _l(gLock); - client = gActiveConnections.valueFor(conn); + client = gActiveConnections.valueFor(conn).promote(); } if (client == 0) { @@ -383,8 +383,8 @@ void SurfaceComposerClient::openGlobalTransaction() const size_t N = gActiveConnections.size(); VERBOSE("openGlobalTransaction (%ld clients)", N); for (size_t i=0; i<N; i++) { - sp<SurfaceComposerClient> client(gActiveConnections.valueAt(i)); - if (gOpenTransactions.indexOf(client) < 0) { + sp<SurfaceComposerClient> client(gActiveConnections.valueAt(i).promote()); + if (client != 0 && gOpenTransactions.indexOf(client) < 0) { if (client->openTransaction() == NO_ERROR) { if (gOpenTransactions.add(client) < 0) { // Ooops! |