summaryrefslogtreecommitdiff
path: root/src/launchpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/launchpad.c')
-rwxr-xr-xsrc/launchpad.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/launchpad.c b/src/launchpad.c
index ebc4d29..cabc266 100755
--- a/src/launchpad.c
+++ b/src/launchpad.c
@@ -131,6 +131,7 @@ static app_labels_monitor *label_monitor;
static GList *launcher_info_list;
static GHashTable *__pid_table;
static int __memory_status;
+static guint __timer;
static candidate_process_context_t *__add_slot(int type, int loader_id,
int caller_pid, const char *loader_path, const char *extra,
@@ -1424,6 +1425,14 @@ static candidate_process_context_t *__find_available_slot(const char *hwacc,
return NULL;
}
+static gboolean __handle_slot_update(gpointer data)
+{
+ _D("[__LAUNCHPAD__] Handle slot update");
+ __add_idle_checker(METHOD_INSTALL, candidate_slot_list);
+ __timer = 0;
+ return G_SOURCE_REMOVE;
+}
+
static void __update_slot(int type, bool app_exists)
{
candidate_process_context_t *cpc;
@@ -1449,8 +1458,13 @@ static void __update_slot(int type, bool app_exists)
}
if (cpc->pid == CANDIDATE_NONE &&
- cpc->idle_checker == 0)
- __set_idle_checker_timer(cpc);
+ cpc->idle_checker == 0) {
+ if (__timer)
+ g_source_remove(__timer);
+
+ __timer = g_timeout_add(500,
+ __handle_slot_update, NULL);
+ }
}
}
@@ -2139,6 +2153,9 @@ static int __before_loop(int argc, char **argv)
static void __after_loop(void)
{
+ if (__timer)
+ g_source_remove(__timer);
+
__unregister_vconf_events();
if (__pid_table)
g_hash_table_destroy(__pid_table);