DetachedSong: don't declare empty destructor

An explicit destructor prevents usage of implicit move operators, even
if it's empty.  Therefore, declaring a defaulted destructor with GCC
attribute "noinline" does what we want without preventing those
implicit operators.
This commit is contained in:
Max Kellermann 2017-02-08 10:13:58 +01:00
parent 08879d2a20
commit 332baa4f67
2 changed files with 2 additions and 6 deletions

View File

@ -31,11 +31,6 @@ DetachedSong::DetachedSong(const LightSong &other)
start_time(other.start_time),
end_time(other.end_time) {}
DetachedSong::~DetachedSong()
{
/* this destructor exists here just so it won't inlined */
}
bool
DetachedSong::IsRemote() const
{

View File

@ -98,7 +98,8 @@ public:
*/
explicit DetachedSong(const LightSong &other);
~DetachedSong();
gcc_noinline
~DetachedSong() = default;
/* these are declared because the user-defined destructor
above prevents them from being generated implicitly */