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

Commit be982d72 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix flaky crashes caused during LogEvent destroy"

parents 621eef00 3ca36831
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -36,13 +36,13 @@ using std::string;
using android::util::ProtoOutputStream;
using android::util::ProtoOutputStream;


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