aft: Honor AUDIO_FILE_REMOVE events.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 17 Apr 2018 08:05:07 +0000 (10:05 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 6 May 2018 08:45:39 +0000 (10:45 +0200)
If the current audio file has been removed, we should invalidate the
current_aft_row pointer.

aft.c

diff --git a/aft.c b/aft.c
index 2f97297..5233fe9 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -2581,6 +2581,10 @@ static int aft_event_handler(enum afs_events event, struct para_buffer *pb,
                        return ret;
                make_status_items();
                return 1;
+       } case AUDIO_FILE_REMOVE: {
+               if (data == current_aft_row)
+                       current_aft_row = NULL;
+               return 0;
        }
        case BLOB_RENAME:
        case BLOB_REMOVE: