OSDN Git Service

SF: Don't use pointer if promote() fails
authorPablo Ceballos <pceballos@google.com>
Thu, 19 Nov 2015 22:39:14 +0000 (14:39 -0800)
committerPablo Ceballos <pceballos@google.com>
Thu, 19 Nov 2015 22:39:14 +0000 (14:39 -0800)
Bug 25759725

Change-Id: I51f82154bf86ded24503c07f1932b115aa709cd4

services/surfaceflinger/Layer.cpp

index 1c2c05d..2b6e0ec 100644 (file)
@@ -953,12 +953,13 @@ void Layer::pushPendingState() {
             // then it is expired or otherwise invalid. Allow this transaction
             // to be applied as per normal (no synchronization).
             mCurrentState.handle = nullptr;
+        } else {
+            auto syncPoint = std::make_shared<SyncPoint>(
+                    mCurrentState.frameNumber);
+            handleLayer->addSyncPoint(syncPoint);
+            mRemoteSyncPoints.push_back(std::move(syncPoint));
         }
 
-        auto syncPoint = std::make_shared<SyncPoint>(mCurrentState.frameNumber);
-        handleLayer->addSyncPoint(syncPoint);
-        mRemoteSyncPoints.push_back(std::move(syncPoint));
-
         // Wake us up to check if the frame has been received
         setTransactionFlags(eTransactionNeeded);
     }