{
sensor_event_listener::get_instance().set_hup_observer(restore_session);
}
-
- ~initiator()
- {
- _D("Good bye! %s\n", get_client_name());
- clean_up();
- }
};
+void good_bye(void)
+{
+ _I("Good bye! %s\n", get_client_name());
+ clean_up();
+}
+
static initiator g_initiator;
static int g_power_save_state_cb_cnt = 0;
sensor_registered = sensor_client_info::get_instance().is_sensor_registered(sensor_id);
+ // lazy loading after creating static variables
+ atexit(good_bye);
+
handle = sensor_client_info::get_instance().create_handle(sensor_id);
if (handle == MAX_HANDLE_REACHED) {
_E("Maximum number of handles reached, sensor: %s in client %s", get_sensor_name(sensor_id), get_client_name());