unsigned int appcore_get_main_surface(void);
#endif
void appcore_get_app_core(struct appcore **ac);
-#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
-int _appcore_init_suspend_dbus_handler(void *data);
-#endif
#define ENV_START "APP_START_TIME"
#define RESOURCED_FREEZER_PATH "/Org/Tizen/Resourced/Freezer"
#define RESOURCED_FREEZER_INTERFACE "org.tizen.resourced.freezer"
#define RESOURCED_FREEZER_SIGNAL "FreezerState"
+
+int __appcore_init_suspend_dbus_handler(void *data);
+void __appcore_fini_suspend_dbus_handler(void);
#endif
#define SQLITE_FLUSH_MAX (1024*1024)
};
#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
-static GDBusConnection *bus = NULL;
-static guint __suspend_dbus_handler_initialized = 0;
+static GDBusConnection *bus;
+static guint __suspend_dbus_handler_initialized;
#endif
static int __get_locale_resource_dir(char *locale_dir, int size)
{
int r;
- r = _appcore_init_suspend_dbus_handler(&core);
+ r = __appcore_init_suspend_dbus_handler(&core);
if (r == -1) {
_ERR("Initailzing suspended state handler failed");
}
__clear(&core);
#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
__remove_suspend_timer(&core);
+ __appcore_fini_suspend_dbus_handler();
#endif
}
aul_finalize();
}
}
-int _appcore_init_suspend_dbus_handler(void *data)
+int __appcore_init_suspend_dbus_handler(void *data)
{
GError *err = NULL;
return 0;
}
+
+void __appcore_fini_suspend_dbus_handler(void)
+{
+ if (bus == NULL)
+ return;
+
+ if (__suspend_dbus_handler_initialized) {
+ g_dbus_connection_signal_unsubscribe(bus,
+ __suspend_dbus_handler_initialized);
+ __suspend_dbus_handler_initialized = 0;
+ }
+
+ g_object_unref(bus);
+ bus = NULL;
+}
#endif
+