Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d48c83d6 authored by John Reck's avatar John Reck Committed by android-build-merger
Browse files

Merge "Fix NPE in clearTexture()" into nyc-dev

am: 7882592d

* commit '7882592d':
  Fix NPE in clearTexture()
parents adb50762 7882592d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ public:
     */
    bool init();

    bool isInitialized() { return mInitialized; }

    /**
     * Flush the cache.
     *
+6 −1
Original line number Diff line number Diff line
@@ -197,7 +197,12 @@ void Layer::generateTexture() {
}

void Layer::clearTexture() {
    // There's a rare possibility that Caches could have been destroyed already
    // since this method is queued up as a task.
    // Since this is a reset method, treat this as non-fatal.
    if (caches.isInitialized()) {
        caches.textureState().unbindTexture(texture.mId);
    }
    texture.mId = 0;
}