Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/space-dragon.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2014-10-12 14:45:52 +0400
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2014-10-12 14:45:52 +0400
commitab77a6a705c7cdf938117a24c8158c53db2e0611 (patch)
tree9f4149dbd5625e1d0a8605702c10b079be496d89
parenta614cbc2f6034fd613557821d4a3f759e4fea056 (diff)
More cleanup
-rw-r--r--src/game.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/game.c b/src/game.c
index 8801888..df4e80f 100644
--- a/src/game.c
+++ b/src/game.c
@@ -395,12 +395,18 @@ static void free_asteroids()
}
static void handle_window_unload(Window* window) {
- app_timer_cancel(timer); // Cancel timer
- accel_data_service_unsubscribe(); // Disabling accelerometer
- app_focus_service_unsubscribe(); // Unsubscribing from focus
- free_asteroids(); // Free memory from asteroids
- destroy_ui(); // Free memory from UI
- persist_write_int(0, hi_score); // Saving hi score
+ // Cancel timer
+ app_timer_cancel(timer);
+ // Disabling accelerometer
+ accel_data_service_unsubscribe();
+ // Unsubscribing from focus
+ app_focus_service_unsubscribe();
+ // Free memory from asteroids
+ free_asteroids();
+ // Free memory from UI
+ destroy_ui();
+ // Saving hi score
+ persist_write_int(0, hi_score);
}
// Automatic pause on call/notification
@@ -438,9 +444,9 @@ static void long_down_handler(ClickRecognizerRef recognizer, void *context)
static void config_provider(void *context)
{
- window_single_click_subscribe(BUTTON_ID_UP, click_handler);
+ window_single_click_subscribe(BUTTON_ID_UP, click_handler);
window_single_click_subscribe(BUTTON_ID_SELECT, click_handler);
- window_single_click_subscribe(BUTTON_ID_DOWN, click_handler);
+ window_single_click_subscribe(BUTTON_ID_DOWN, click_handler);
window_long_click_subscribe(BUTTON_ID_UP, 10000, long_up_handler, NULL);
window_long_click_subscribe(BUTTON_ID_SELECT, 10000, long_select_handler, NULL);
window_long_click_subscribe(BUTTON_ID_DOWN, 3000, long_down_handler, NULL);
@@ -486,7 +492,7 @@ void show_game() {
window_set_window_handlers(s_window, (WindowHandlers) {
.unload = handle_window_unload,
- });
+ });
// The layer
Layer *window_layer = window_get_root_layer(s_window);