static void launch_app(int type)
{
app_control_h app_control = NULL;
- int ret;
+ int ret = -1;
ret = app_control_create(&app_control);
if (ret != APP_CONTROL_ERROR_NONE)
ret = app_control_set_app_id(app_control, ODE_APPNAME);
} else {
_E("No matched type(%d)", type);
- return;
+ goto out;
}
if (ret != APP_CONTROL_ERROR_NONE) {
- (void)app_control_destroy(app_control);
- return;
+ _E("Fail to set app id");
+ goto out;
}
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
- _E("Failed to send launch request");
+ _E("Fail to send launch request");
- (void)app_control_destroy(app_control);
+out:
+ if (app_control) {
+ (void)app_control_destroy(app_control);
+ app_control = NULL;
+ }
}
static void send_general_mount_signal(const struct popup_ops *ops)
{
app_control_h app_control;
- int ret, i, type_len;
+ int ret = -1, i, type_len;
type_len = ARRAY_SIZE(app_type);
for (i = 0 ; i < ARRAY_SIZE(app_type) ; i++) {
ret = app_control_set_app_id(app_control, GALLERY_APPNAME);
else {
_E("No matched type(%d)", type);
- return;
+ goto out;
}
if (ret != APP_CONTROL_ERROR_NONE) {
- (void)app_control_destroy(app_control);
- return;
+ _E("Fail to set app id");
+ goto out;
}
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
- _E("Failed to send launch request");
+ _E("Fail to send launch request");
- (void)app_control_destroy(app_control);
+out:
+ if (app_control) {
+ (void)app_control_destroy(app_control);
+ app_control = NULL;
+ }
}
static void storage_browse(const struct popup_ops *ops)