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

Commit 7c0edebd authored by Steven Moreland's avatar Steven Moreland
Browse files

libbinder: Do not destruct TextOutput

Recent changes meant that a log is more likely during process shutdown,
given certain races w/ alog. However, this should have still been
possible before. Allocating TextOutput objects on the heap to avoid them
getting destructed.

Fixes: 149516130
Test: while ! cmd activity get-current-user 2>&1 | grep FORTIFY; do :; done
Change-Id: Ie5c066172203172a80c135ad5aa7da09b362ee73
parent f2a15e87
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -64,13 +64,9 @@ private:
    int mFD;
};

static LogTextOutput gLogTextOutput;
static FdTextOutput gStdoutTextOutput(STDOUT_FILENO);
static FdTextOutput gStderrTextOutput(STDERR_FILENO);

TextOutput& alog(gLogTextOutput);
TextOutput& aout(gStdoutTextOutput);
TextOutput& aerr(gStderrTextOutput);
TextOutput& alog(*new LogTextOutput());
TextOutput& aout(*new FdTextOutput(STDOUT_FILENO));
TextOutput& aerr(*new FdTextOutput(STDERR_FILENO));

// ------------ ProcessState.cpp