0

App Store can not close my application (which I send there) if update exists.

App Store asks me "Can I close this application?". I say "Yes". It hangs for some seconds and next ask me again "Can I close this application?"

I saw OSX event logs, but there are nothing

Qt 5.4
OSX 10.10.2
Lucifer
  • 29,392
  • 25
  • 90
  • 143
fhdnsYa
  • 443
  • 1
  • 6
  • 15

1 Answers1

1

The App store probably sends a SIGTERM signal to notify your process to close. Because you are not handling it, nothing happens. You need to implement a unix signal handler as shown in this "Calling Qt Functions From Unix Signal Handlers" tutorial.

Something like this untested mess:

int setup_unix_signal_handlers()
{
    struct sigaction term;

    term.sa_handler = ::termSignalHandler;
    sigemptyset(&term.sa_mask);
    term.sa_flags |= SA_RESTART;

    return sigaction(SIGTERM, &term, 0);
}

void termSignalHandler(int)
{
    QCoreApplication::exit(0);
}

int main(int argc, char *argv[])
{
    setup_unix_signal_handlers();
    QCoreApplication a(argc, argv);
    return a.exec();
}

Comprehensive explanation of signal handling : Simple Linux Signal Handling

Community
  • 1
  • 1
UmNyobe
  • 22,539
  • 9
  • 61
  • 90