- Electron version: 1.1.0
- Operating system: Windows
- Use case: cleanup and reporting tasks executed on quit (headless), which may take time and should not prevent from opening a new instance.
- Proposed solutions:
  - new _app.releaseSingleInstance()_ API which free the singleInstance lock
  - replace _app.releaseSingleInstance()_ API by an event listener (which may be listened/unlistened)
  - [app.makeSingleInstance](https://github.com/electron/electron/blob/master/docs/api/app.md#appmakesingleinstancecallback) returns the result of the callback function. So we can choose to quit or not in a more accurate way.
  - Provide a communication channel between the new instance and the main one (in callback arguments)

atom/browser/api/atom_api_app.cc
CertificateManagerModel* model,
    const base::DictionaryValue& options) {
  std::string file_data, cert_path;
  base::string16 password;
  net::CertificateList imported_certs;
  int rv = -1;
  options.GetString("certificate", &cert_path);
  options.GetString("password", &password);
  if (!cert_path.empty()) {
    if (base::ReadFileToString(base::FilePath(cert_path), &file_data)) {
      auto module = model->cert_db()->GetPublicModule();
      rv = model->ImportFromPKCS12(module,
                                   file_data,
                                   password,
                                   true,
                                   &imported_certs);
      if (imported_certs.size() > 1) {
        auto it = imported_certs.begin();
        ++it;  
        for (; it != imported_certs.end(); ++it)
          rv &= model->SetCertTrust(it->get(),
                                    net::CA_CERT,
                                    net::NSSCertDatabase::TRUSTED_SSL);
      }
    }
  }
  return rv;
}
#endif
}