Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/electron/electron.git
π Add 'app.releaseSingleInstance()'
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
c1272743b9
ΠΠΎΠΌΠΌΠΈΡ
f4c3f0423a
|
@ -401,6 +401,13 @@ bool App::MakeSingleInstance(
|
|||
}
|
||||
}
|
||||
|
||||
void App::ReleaseSingleInstance() {
|
||||
if (process_singleton_.get()) {
|
||||
process_singleton_->Cleanup();
|
||||
process_singleton_.reset();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(USE_NSS_CERTS)
|
||||
void App::ImportCertificate(
|
||||
const base::DictionaryValue& options,
|
||||
|
@ -480,7 +487,8 @@ void App::BuildPrototype(
|
|||
#if defined(USE_NSS_CERTS)
|
||||
.SetMethod("importCertificate", &App::ImportCertificate)
|
||||
#endif
|
||||
.SetMethod("makeSingleInstance", &App::MakeSingleInstance);
|
||||
.SetMethod("makeSingleInstance", &App::MakeSingleInstance)
|
||||
.SetMethod("releaseSingleInstance", &App::ReleaseSingleInstance);
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
|
@ -108,6 +108,7 @@ class App : public AtomBrowserClient::Delegate,
|
|||
void SetDesktopName(const std::string& desktop_name);
|
||||
bool MakeSingleInstance(
|
||||
const ProcessSingleton::NotificationCallback& callback);
|
||||
void ReleaseSingleInstance();
|
||||
std::string GetLocale();
|
||||
|
||||
#if defined(USE_NSS_CERTS)
|
||||
|
|
|
@ -496,6 +496,11 @@ app.on('ready', () => {
|
|||
});
|
||||
```
|
||||
|
||||
### `app.releaseSingleInstance()`
|
||||
|
||||
Releases all locks that were created by `makeSingleInstance`. This will allow
|
||||
multiple instances of the application to once again run side by side.
|
||||
|
||||
### `app.setUserActivity(type, userInfo[, webpageURL])` _OS X_
|
||||
|
||||
* `type` String - Uniquely identifies the activity. Maps to
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅