Allow Sandbox applications to exit.
This commit is contained in:
parent
5466d6a11d
commit
8a70d10401
5 changed files with 107 additions and 0 deletions
|
|
@ -131,6 +131,13 @@ pub trait Sandbox {
|
|||
1.0
|
||||
}
|
||||
|
||||
/// Returns whether the [`Sandbox`] should be terminated.
|
||||
///
|
||||
/// By default, it returns `false`.
|
||||
fn should_exit(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Runs the [`Sandbox`].
|
||||
///
|
||||
/// On native platforms, this method will take control of the current thread
|
||||
|
|
@ -182,4 +189,8 @@ where
|
|||
fn scale_factor(&self) -> f64 {
|
||||
T::scale_factor(self)
|
||||
}
|
||||
|
||||
fn should_exit(&self) -> bool {
|
||||
T::should_exit(self)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue