Compare commits

..

3 Commits

Author SHA1 Message Date
Max Kellermann
938728820b release v0.22.6 2021-02-16 13:56:14 +01:00
Max Kellermann
80531ef8d8 db/simple: fix ExportedSong move constructor for non-owning sources
If the constructor moves from an ExportedSong instance which refers to
somebody else's "Tag" instance, the newly constructed instance will
instead refer to its own empty "tag_buffer" field.  This broke
SimpleDatabase::GetSong(), i.e. all songs on the queue restored from
the state file or added using the "addid" command.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1089
2021-02-16 13:52:25 +01:00
Max Kellermann
a91fba6a3d increment version number to 0.22.6 2021-02-16 13:47:33 +01:00
5 changed files with 24 additions and 5 deletions

3
NEWS

@@ -1,3 +1,6 @@
ver 0.22.6 (2021/02/16)
* fix missing tags on songs in queue
ver 0.22.5 (2021/02/15)
* protocol
- error for malformed ranges instead of ignoring silently

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.musicpd"
android:installLocation="auto"
android:versionCode="53"
android:versionName="0.22.5">
android:versionCode="54"
android:versionName="0.22.6">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>

@@ -38,7 +38,7 @@ author = 'Max Kellermann'
# built documents.
#
# The short X.Y version.
version = '0.22.5'
version = '0.22.6'
# The full version, including alpha/beta/rc tags.
release = version

@@ -1,7 +1,7 @@
project(
'mpd',
['c', 'cpp'],
version: '0.22.5',
version: '0.22.6',
meson_version: '>= 0.49.0',
default_options: [
'c_std=c11',

@@ -29,6 +29,12 @@
* a #LightSong, e.g. a merged #Tag.
*/
class ExportedSong : public LightSong {
/**
* A reference target for LightSong::tag, but it is only used
* if this instance "owns" the #Tag. For instances referring
* to a foreign #Tag instance (e.g. a Song::tag), this field
* is not used (and empty).
*/
Tag tag_buffer;
public:
@@ -42,10 +48,20 @@ public:
points to this instance's #Tag field instead of leaving a
dangling reference to the source object's #Tag field */
ExportedSong(ExportedSong &&src) noexcept
:LightSong(src, tag_buffer),
:LightSong(src,
/* refer to tag_buffer only if the
moved-from instance also owned the Tag
which its LightSong::tag field refers
to */
OwnsTag() ? tag_buffer : src.tag),
tag_buffer(std::move(src.tag_buffer)) {}
ExportedSong &operator=(ExportedSong &&) = delete;
private:
bool OwnsTag() const noexcept {
return &tag == &tag_buffer;
}
};
#endif