From cbb742a7cca4af14690234ac9127712f6bb1eeb0 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 18 Sep 2012 12:16:16 +0000 Subject: [PATCH] patch from Sergei Kabanov to fix possible crash in efm with udisks/hal backends ticket #1529 SVN revision: 76814 --- src/bin/e_fm/e_fm_main_hal.c | 9 ++++++--- src/bin/e_fm/e_fm_main_udisks.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/bin/e_fm/e_fm_main_hal.c b/src/bin/e_fm/e_fm_main_hal.c index 1a1e2d42e..d2e478e83 100644 --- a/src/bin/e_fm/e_fm_main_hal.c +++ b/src/bin/e_fm/e_fm_main_hal.c @@ -675,7 +675,8 @@ _e_fm_main_hal_vol_mount_timeout(void *data) int size; v->guard = NULL; - dbus_pending_call_cancel(v->op); + if (!dbus_pending_call_get_completed(v->op)) + dbus_pending_call_cancel(v->op); error.name = "org.enlightenment.fm2.MountTimeout"; error.message = "Unable to mount the volume with specified time-out."; size = _e_fm_main_hal_format_error_msg(&buf, v, &error); @@ -734,7 +735,8 @@ _e_fm_main_hal_vol_unmount_timeout(void *data) int size; v->guard = NULL; - dbus_pending_call_cancel(v->op); + if (!dbus_pending_call_get_completed(v->op)) + dbus_pending_call_cancel(v->op); error.name = "org.enlightenment.fm2.UnmountTimeout"; error.message = "Unable to unmount the volume with specified time-out."; size = _e_fm_main_hal_format_error_msg(&buf, v, &error); @@ -793,7 +795,8 @@ _e_fm_main_hal_vol_eject_timeout(void *data) int size; v->guard = NULL; - dbus_pending_call_cancel(v->op); + if (!dbus_pending_call_get_completed(v->op)) + dbus_pending_call_cancel(v->op); error.name = "org.enlightenment.fm2.EjectTimeout"; error.message = "Unable to eject the media with specified time-out."; size = _e_fm_main_hal_format_error_msg(&buf, v, &error); diff --git a/src/bin/e_fm/e_fm_main_udisks.c b/src/bin/e_fm/e_fm_main_udisks.c index 1bf44360e..e509409bb 100644 --- a/src/bin/e_fm/e_fm_main_udisks.c +++ b/src/bin/e_fm/e_fm_main_udisks.c @@ -588,7 +588,8 @@ _e_fm_main_udisks_vol_mount_timeout(E_Volume *v) int size; v->guard = NULL; - dbus_pending_call_cancel(v->op); + if (!dbus_pending_call_get_completed(v->op)) + dbus_pending_call_cancel(v->op); v->op = NULL; v->optype = E_VOLUME_OP_TYPE_NONE; error.name = "org.enlightenment.fm2.MountTimeout"; @@ -648,7 +649,8 @@ _e_fm_main_udisks_vol_unmount_timeout(E_Volume *v) int size; v->guard = NULL; - dbus_pending_call_cancel(v->op); + if (!dbus_pending_call_get_completed(v->op)) + dbus_pending_call_cancel(v->op); v->op = NULL; v->optype = E_VOLUME_OP_TYPE_NONE; error.name = "org.enlightenment.fm2.UnmountTimeout"; @@ -709,7 +711,8 @@ _e_fm_main_udisks_vol_eject_timeout(E_Volume *v) int size; v->guard = NULL; - dbus_pending_call_cancel(v->op); + if (!dbus_pending_call_get_completed(v->op)) + dbus_pending_call_cancel(v->op); v->op = NULL; v->optype = E_VOLUME_OP_TYPE_NONE; error.name = "org.enlightenment.fm2.EjectTimeout";