mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Context as Activity member; on_destroy context is released
This commit is contained in:
@@ -38,17 +38,19 @@ pub trait Activity {
|
||||
///
|
||||
/// `on_create` is the function which must be called to initialize the activity.
|
||||
/// `on_create` must initialize all the data structures used by the activity
|
||||
fn on_create(&mut self, context: &mut Context);
|
||||
/// Context is taken from activity manager and will be released only when activity is destroyed
|
||||
fn on_create(&mut self, context: Context);
|
||||
|
||||
/// ### on_draw
|
||||
///
|
||||
/// `on_draw` is the function which draws the graphical interface.
|
||||
/// This function must be called at each tick to refresh the interface
|
||||
fn on_draw(&mut self, context: &mut Context);
|
||||
fn on_draw(&mut self);
|
||||
|
||||
/// ### on_destroy
|
||||
///
|
||||
/// `on_destroy` is the function which cleans up runtime variables and data before terminating the activity.
|
||||
/// This function must be called once before terminating the activity.
|
||||
fn on_destroy(&mut self, context: &mut Context);
|
||||
/// This function finally releases the context
|
||||
fn on_destroy(&mut self) -> Option<Context>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user