fixed the sigfault when quitting by adding a boolean

Signed-off-by: Lasconik <caillouxnicolas@gmail.com>