Revert previous cycling-reference commit.

This commit is contained in:
Jiancong 2018-04-05 22:06:43 +08:00
commit 48471b1454
3 changed files with 6 additions and 8 deletions

View file

@ -100,7 +100,7 @@ protected:
* @brief Traps the specified signals for the entire process.
*/
CORE_POSIX_DLL_PUBLIC
SignalTrap* trap_signals_for_process(
std::shared_ptr<SignalTrap> trap_signals_for_process(
std::initializer_list<core::posix::Signal> blocked_signals);
/**

View file

@ -203,10 +203,12 @@ private:
};
}
core::posix::SignalTrap* core::posix::trap_signals_for_process(
std::shared_ptr<core::posix::SignalTrap> core::posix::trap_signals_for_process(
std::initializer_list<core::posix::Signal> blocked_signals)
{
return new impl::SignalTrap(impl::SignalTrap::Scope::process, blocked_signals);
return std::make_shared<impl::SignalTrap>(
impl::SignalTrap::Scope::process,
blocked_signals);
}
std::shared_ptr<core::posix::SignalTrap> core::posix::trap_signals_for_all_subsequent_threads(

View file

@ -131,7 +131,7 @@ anbox::cmds::SessionManager::SessionManager()
use_system_dbus_));
action([this](const cli::Command::Context &) {
core::posix::SignalTrap* trap = core::posix::trap_signals_for_process(
auto trap = core::posix::trap_signals_for_process(
{core::posix::Signal::sig_term, core::posix::Signal::sig_int});
trap->signal_raised().connect([trap](const core::posix::Signal &signal) {
INFO("Signal %i received. Good night.", static_cast<int>(signal));
@ -139,13 +139,11 @@ anbox::cmds::SessionManager::SessionManager()
});
if (standalone_ && !experimental_) {
delete trap;
ERROR("Experimental features selected, but --experimental flag not set");
return EXIT_FAILURE;
}
if (!fs::exists("/dev/binder") || !fs::exists("/dev/ashmem")) {
delete trap;
ERROR("Failed to start as either binder or ashmem kernel drivers are not loaded");
return EXIT_FAILURE;
}
@ -179,7 +177,6 @@ anbox::cmds::SessionManager::SessionManager()
display_frame,
single_window_);
if (!platform) {
delete trap;
return EXIT_FAILURE;
}
@ -287,7 +284,6 @@ anbox::cmds::SessionManager::SessionManager()
rt->stop();
delete trap;
return EXIT_SUCCESS;
});
}