account for canceled operations (no events for these), remove freed disks from event...
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 16 May 2011 11:32:11 +0000 (11:32 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 16 May 2011 11:32:11 +0000 (11:32 +0000)
SVN revision: 59446

legacy/eeze/src/lib/eeze_disk.c
legacy/eeze/src/lib/eeze_disk_mount.c

index 2af2308b0078fc5cf0a3ed61fd38e7d95d9845fa..1adc23c196875c085d52d9e8a41b585579e59ae2 100644 (file)
@@ -190,6 +190,7 @@ error:
 EAPI void
 eeze_disk_free(Eeze_Disk *disk)
 {
+   extern Eina_List *eeze_events;
    EINA_SAFETY_ON_NULL_RETURN(disk);
 
    udev_device_unref(disk->device);
@@ -201,6 +202,7 @@ eeze_disk_free(Eeze_Disk *disk)
      eina_strbuf_free(disk->eject_cmd);
    if (disk->mounter) ecore_exe_kill(disk->mounter);
    _eeze_disks = eina_list_remove(_eeze_disks, disk);
+   eeze_events = eina_list_remove(eeze_events, disk);
    free(disk);
 }
 
index 89120415c6d0a8a2eb3313bba973a2a753430fb1..fb85b2d602fb1b7e4cc061e00211d185c1104a30 100644 (file)
@@ -18,7 +18,7 @@ EAPI int EEZE_EVENT_DISK_UNMOUNT = 0;
 EAPI int EEZE_EVENT_DISK_EJECT = 0;
 EAPI int EEZE_EVENT_DISK_ERROR = 0;
 static Ecore_Event_Handler *_mount_handler = NULL;
-static Eina_List *eeze_events = NULL;
+Eina_List *eeze_events = NULL;
 
 /*
  *
@@ -67,6 +67,11 @@ _eeze_disk_mount_result_handler(void *data __UNUSED__, int type __UNUSED__, Ecor
      return ECORE_CALLBACK_RENEW;
 
    eeze_events = eina_list_remove_list(eeze_events, l);
+   if (!disk->mounter) /* killed */
+     {
+        disk->mount_status = EEZE_DISK_NULL;
+        return ECORE_CALLBACK_RENEW;
+     }
    if (disk->mount_status == EEZE_DISK_MOUNTING)
      {
         disk->mounter = NULL;