Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

void mpd_song_free ( struct mpd_song song  ) 

Free memory allocated by the mpd_song object.

Definition at line 118 of file song.c.

References mpd_song_free(), mpd_song::tags, and mpd_song::uri.

Referenced by mpd_entity_free(), mpd_recv_song(), mpd_run_current_song(), mpd_run_get_queue_song_id(), mpd_run_get_queue_song_pos(), mpd_song_dup(), and mpd_song_free().

                                          {
      assert(song != NULL);

      free(song->uri);

      for (unsigned i = 0; i < MPD_TAG_COUNT; ++i) {
            struct mpd_tag_value *tag = &song->tags[i], *next;

            if (tag->value == NULL)
                  continue;

            free(tag->value);

            tag = tag->next;

            while (tag != NULL) {
                  assert(tag->value != NULL);
                  free(tag->value);

                  next = tag->next;
                  free(tag);
                  tag = next;
            }
      }

      free(song);
}


Generated by  Doxygen 1.6.0   Back to index