mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
core: remove pid file on shutdown
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
7d7eef7ff4
commit
9bb21fc726
1 changed files with 8 additions and 0 deletions
|
@ -2409,6 +2409,7 @@ int main(int argc, char **argv) {
|
||||||
// Main loop
|
// Main loop
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
int ret_code = 0;
|
int ret_code = 0;
|
||||||
|
char *pid_file = NULL;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
Display *dpy = XOpenDisplay(NULL);
|
Display *dpy = XOpenDisplay(NULL);
|
||||||
|
@ -2451,6 +2452,9 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
session_run(ps_g);
|
session_run(ps_g);
|
||||||
quit = ps_g->quit;
|
quit = ps_g->quit;
|
||||||
|
if (quit && ps_g->o.write_pid_path) {
|
||||||
|
pid_file = strdup(ps_g->o.write_pid_path);
|
||||||
|
}
|
||||||
session_destroy(ps_g);
|
session_destroy(ps_g);
|
||||||
free(ps_g);
|
free(ps_g);
|
||||||
ps_g = NULL;
|
ps_g = NULL;
|
||||||
|
@ -2460,6 +2464,10 @@ int main(int argc, char **argv) {
|
||||||
} while (!quit);
|
} while (!quit);
|
||||||
|
|
||||||
free(config_file);
|
free(config_file);
|
||||||
|
if (pid_file) {
|
||||||
|
log_trace("remove pid file %s", pid_file);
|
||||||
|
unlink(pid_file);
|
||||||
|
}
|
||||||
|
|
||||||
log_deinit_tls();
|
log_deinit_tls();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue