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

Commit 3ca36831 authored by Chenjie Yu's avatar Chenjie Yu
Browse files

Fix flaky crashes caused during LogEvent destroy

Test: cts tested
Change-Id: I0329a64506b5838d2572cda0d1b86ad78bae4253
parent 0e5f9c8a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -36,13 +36,13 @@ using std::string;
using android::util::ProtoOutputStream;

LogEvent::LogEvent(log_msg& msg) {
    android_log_context context =
    mContext =
            create_android_log_parser(msg.msg() + sizeof(uint32_t), msg.len() - sizeof(uint32_t));
    mTimestampNs = msg.entry_v1.sec * NS_PER_SEC + msg.entry_v1.nsec;
    mLogUid = msg.entry_v4.uid;
    init(context);
    if (context) {
        android_log_destroy(&context);
    init(mContext);
    if (mContext) {
        android_log_destroy(&mContext);
    }
}