From: Andre Noll Date: Thu, 1 Nov 2007 23:49:03 +0000 (+0100) Subject: Fix duplicate afs event add. X-Git-Tag: v0.3.0~135 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c30fa77db9a1a4f75dc5814cb9f4ecbd32aa110a Fix duplicate afs event add. This bug hits if a request to update an existing audio file is made. The old code caused an AFHI_CHANGE event and then did "goto out;" which raises nother event (AUDIO_FILE_ADD). Fix it by moving the event-raising code some lines up. --- diff --git a/aft.c b/aft.c index fae883b4..02953b5c 100644 --- a/aft.c +++ b/aft.c @@ -1609,6 +1609,7 @@ static int com_add_callback(const struct osl_object *query, objs[AFTCOL_AFSI].size = AFSI_SIZE; save_afsi(&default_afsi, &objs[AFTCOL_AFSI]); ret = osl_add_and_get_row(audio_file_table, objs, &aft_row); + afs_event(AUDIO_FILE_ADD, &msg, aft_row); out: if (ret < 0) para_printf(&msg, "%s\n", PARA_STRERROR(-ret)); @@ -1616,7 +1617,6 @@ out: return 0; result->data = msg.buf; result->size = msg.size; - afs_event(AUDIO_FILE_ADD, &msg, aft_row); return 1; }