HWUI: mSerialContext needs to outlive other serializing members

mSerialContext is used as the serialization context, and need to
outlive mOpenMultiPicStream and mMultiPic and those are referencing
it in SkSharingSerialContext SkSharingSerialContext::serializeImage

Test: https://buganizer.corp.google.com/issues/182710292#comment16
Bug: 183049238
Change-Id: I25842e492d5efd7a7532964bddca61559d50ebe1
This commit is contained in:
Ady Abraham
2021-05-10 21:20:25 -07:00
parent 38e5def5ce
commit b154792a39

View File

@@ -137,9 +137,10 @@ private:
int mCaptureSequence = 0;
// Multi frame serialization stream and writer used when serializing more than one frame.
std::unique_ptr<SkSharingSerialContext> mSerialContext; // Must be declared before any other
// serializing member
std::unique_ptr<SkFILEWStream> mOpenMultiPicStream;
sk_sp<SkDocument> mMultiPic;
std::unique_ptr<SkSharingSerialContext> mSerialContext;
/**
* mRecorder holds the current picture recorder when serializing in either SingleFrameSKP or