extern void lb_fini(void);
extern int lb_create(const char *pkgname, const char *id, const char *content_info, int timeout, int has_livebox_script, double period, const char *cluster, const char *category, int *w, int *h, double *priority, int skip_need_to_create, const char *abi, char **out_content, char **out_title);
-extern int lb_destroy(const char *pkgname, const char *id);
+extern int lb_destroy(const char *pkgname, const char *id, int type);
extern int lb_resize(const char *pkgname, const char *id, int w, int h);
extern int lb_clicked(const char *pkgname, const char *id, const char *event, double timestamp, double x, double y);
extern int so_is_updated(struct instance *inst);
extern int so_need_to_destroy(struct instance *inst);
extern int so_update(struct instance *inst);
-extern int so_destroy(struct instance *inst);
+extern int so_destroy(struct instance *inst, int unload);
extern int so_clicked(struct instance *inst, const char *event, double timestamp, double x, double y);
extern int so_script_event(struct instance *inst, const char *emission, const char *source, struct event_info *event_info);
extern int so_resize(struct instance *inst, int w, int h);
int is_lb_show;
int is_pd_show;
int is_lb_updated;
+ int unload_so;
};
static struct info {
if (ret <= 0) {
if (so_need_to_destroy(item->inst) == NEED_TO_DESTROY) {
provider_send_deleted(item->inst->item->pkgname, item->inst->id);
- lb_destroy(item->inst->item->pkgname, item->inst->id);
+ lb_destroy(item->inst->item->pkgname, item->inst->id, INSTANCE_DESTROY_DEFAULT);
/*!
* \CRITICAL
* Every caller of this, must not access the item from now.
if (item->deleteme) {
update_monitor_del(item->inst->id, item);
provider_send_deleted(item->inst->item->pkgname, item->inst->id);
- (void)so_destroy(item->inst);
+ (void)so_destroy(item->inst, item->unload_so);
free(item);
return EXIT_FAILURE;
}
if (ret <= 0) {
if (so_need_to_destroy(item->inst) == NEED_TO_DESTROY) {
provider_send_deleted(item->inst->item->pkgname, item->inst->id);
- lb_destroy(item->inst->item->pkgname, item->inst->id);
+ lb_destroy(item->inst->item->pkgname, item->inst->id, INSTANCE_DESTROY_DEFAULT);
/*!
* \CRITICAL
* Every caller of this, must not access the item from now.
if (!item->timer) {
ErrPrint("Failed to add timer (%s - %s, content[%s], cluster[%s], category[%s], abi[%s]\n", pkgname, id, content_info, cluster, category, abi);
update_monitor_del(id, item);
- (void)so_destroy(inst);
+ (void)so_destroy(inst, item->unload_so);
free(item);
return LB_STATUS_ERROR_FAULT;
}
return need_to_create;
}
-HAPI int lb_destroy(const char *pkgname, const char *id)
+HAPI int lb_destroy(const char *pkgname, const char *id, int type)
{
Eina_List *l;
Eina_List *n;
item->timer = NULL;
}
+ /*
+ * To keep the previous status, we should or'ing the value.
+ */
+ item->unload_so = (item->unload_so || (type == INSTANCE_DESTROY_UNINSTALL));
+
if (item->monitor) {
item->deleteme = 1;
} else {
update_monitor_del(id, item);
free(item);
- (void)so_destroy(inst);
+ (void)so_destroy(inst, item->unload_so);
}
return LB_STATUS_SUCCESS;
}
update_monitor_del(item->inst->id, item);
- (void)so_destroy(item->inst);
+ (void)so_destroy(item->inst, item->unload_so);
free(item);
cnt++;
}
EINA_LIST_FOREACH_SAFE(s_info.item_list, l, n, item) {
update_monitor_del(item->inst->id, item);
- (void)so_destroy(item->inst);
+ (void)so_destroy(item->inst, item->unload_so);
free(item);
cnt++;
}