1
0
mirror of https://github.com/topjohnwu/Magisk.git synced 2025-04-01 21:12:15 +00:00

Only run destructor if necessary

This commit is contained in:
topjohnwu 2021-09-22 02:52:33 -07:00
parent cf4ef54dc5
commit da38f59e62

@ -63,10 +63,12 @@ static void sanitize_environ() {
__attribute__((destructor))
static void zygisk_cleanup_wait() {
if (self_handle) {
// Wait 10us to make sure none of our code is executing
timespec ts = { .tv_sec = 0, .tv_nsec = 10000L };
nanosleep(&ts, nullptr);
}
}
#define SECOND_STAGE_PTR "ZYGISK_PTR"